Prettier code formatter

Format JavaScript, TypeScript, JSON, HTML, CSS, Markdown, YAML, GraphQL, and related files with Prettier directly in your browser.

Source code

Paste JavaScript, TypeScript, JSON, HTML, CSS, Markdown, YAML, GraphQL, or related files and format them in the browser with Prettier.

Formatting options

Choose the parser and style rules without editing the source by hand.

Language
Indentation
Style
Trailing commas

Formatted output

The preview uses the selected Prettier parser and options below.

What does the Prettier code formatter do?

Prettier Code Formatter runs the official Prettier standalone pipeline directly in your browser so you can normalize source files without sending code to a server. It is useful when you need a quick formatting pass, want to compare different print settings, or need a clean file you can copy or download immediately.

Supported formats

Format JavaScript, JSX, TypeScript, TSX, Flow, JSON variants, HTML, XML, CSS, PostCSS, SCSS, Less, Markdown, MDX, YAML, GraphQL, and template formats such as Angular, Vue, Svelte, LWC, MJML, and Handlebars. Choose a language to select its parser. When you import a file with a recognized extension, the parser is selected automatically.

How formatting works

Formatting runs in the background to keep typing responsive. Large inputs pause automatic formatting; use the explicit Format now action to format the document when you are ready.

How to use

Choose a language or dialect, paste or import source, adjust options, then format and copy or download the complete result