Code formatter

Pick a language, paste code and adjust print width, indentation, semicolons and quotes. “Show changes” displays a side-by-side diff of what the formatter did.

Loading the editor…

Which formatter runs

JavaScript, TypeScript, JSX, CSS, SCSS, Less, HTML, Markdown, YAML and JSON are formatted by Prettier 3 running in a Web Worker. SQL uses sql-formatter with the SQLite dialect, and XML uses a built-in pretty printer. Python, Java, Go, Rust and C++ formatters are not bundled and are labelled as unsupported rather than faked.

Safe failure

If the input does not parse, the formatter stops and tells you the line; your input is never partially rewritten. Inside the full editor, formatting is a single undoable change.

Questions

Is this the real Prettier?

Yes, the official standalone build of Prettier 3 with its parser plugins, running in your browser.

Can I format only a selection?

In the editor, use “Format selection” from the command palette. Prettier then formats the smallest enclosing range.

Where are my settings stored?

Formatting options in the editor are saved in your browser’s local storage.