Choose the language and format your source with Prettier. Compare or copy the output; the workspace does not execute your code.
Runs locally in your browserThe enhanced editor loads only on this page. If it cannot start, the same local formatter stays available in the fallback field.
Formatting changes whitespace and layout; always retain a project copy before applying broad code transformations.
The workspace formats eight languages — JavaScript, TypeScript, JSON, CSS, HTML, Markdown, YAML and GraphQL — with Prettier 3.9.6 running inside the page. Choose the language, put the source in the left pane and press Format code; the right pane shows the result.
The enhanced editor is Monaco 0.56.0, loaded from this site after the page itself: the plain-text pane works immediately and keeps working if the editor cannot start. Between the two, the page serves about 1.8 MB of editor and formatter files from voritools.com, and nothing you paste is sent anywhere.
JavaScript and TypeScript go through the Babel and TypeScript parsers, so JSX and type syntax pass through and generics such as <T,> keep working. JSON, CSS, HTML, Markdown, YAML and GraphQL each have a dedicated parser: unclosed HTML tags are closed, for example, and a minified CSS rule is printed with one declaration per line. Every language has a sample behind Load example.
There is no options panel, so Prettier’s defaults are used as they come: two-space indentation, double quotes and semicolons in JavaScript and TypeScript, trailing commas in multiline constructs, and an 80-column print width. The page only changes whitespace and layout; it does not execute the code, install dependencies or read a project’s .prettierrc, so the result can differ from the same file formatted by a project script that sets its own options.
The JSON view is Prettier’s JSON parser, not a strict RFC 8259 validator. Measured on this page: a document with single-quoted strings, unquoted keys, a trailing comma, a // comment, a hexadecimal number or Infinity formats without an error. Single quotes, unquoted keys and trailing commas are rewritten in the output; comments, 0x10 and Infinity are carried through unchanged.
A document can therefore format cleanly here and still be rejected elsewhere: {"a":1} // note and {"a":Infinity} come back with the comment and the Infinity value intact. Before the result goes to an API, a configuration file or another language, check it with the JSON Formatter page, which rejects comments and trailing commas.
Prettier and the editor are served from this site, and formatting happens in the browser: the page sends neither the source nor the result anywhere, and it keeps working after the network drops. If the editor cannot start, the same formatter stays available in the plain-text pane.
Because the work happens in the tab, large files are limited by the memory of the device — a 112 KB JavaScript file was formatted in about 0.2 seconds here, while a file of many megabytes can freeze the tab. Keep the file under version control before replacing it with the output: the formatter rewrites syntax as Prettier prints it, not as it was written.