Overview
Format messy code with real Prettier - the same opinionated formatter your team's CI runs. JavaScript, TypeScript, CSS, SCSS, LESS, HTML, Markdown, YAML, and JSON are supported, each with its proper parser. Paste, get instantly formatted output with consistent indentation and quotes, and copy it back into your project.
How It Works
Pick the language tab, paste your code, and the formatted result appears as you type or change language. Errors from the parser - an unbalanced bracket, a bad token - are shown verbatim with their position so you can fix the input rather than guess. The formatted output is click-to-copy. Switching language re-formats the same text with that language's parser and defaults.
Step-by-Step Usage Guide
- Choose the language tab matching your snippet - the parser changes with it.
- Paste your minified, pasted-from-email, or hand-indented code.
- Read the formatted output; if a syntax error appears, fix the reported position in your input.
- Copy the result back into your file, then let your project's own Prettier config own future formatting.
Technical Specifications & Standards
This is Prettier 3's standalone build, loaded through dynamic imports so the formatter core and each language plugin (babel, typescript, postcss, html, markdown, yaml) are only downloaded when used - the plugin for the selected language is fetched on demand and cached by the browser. Standalone mode is the same code path Prettier uses in editors: the parse-print cycle parses your source into an AST, discards all original whitespace and line breaks, and re-prints from the AST at a 100-character print width with Prettier's defaults - normalized quotes, trailing commas where valid, and consistent indentation. That round-trip is also what makes it a syntax validator: code that cannot be parsed cannot be printed, so any error you see is a real syntax error with the position the parser found. Because output is derived from the AST, formatting is idempotent - running it twice changes nothing, which is the property that makes shared formatter configs work.
Targeted Use Cases
- Untangling a minified JS or CSS snippet you need to read and patch quickly.
- Normalizing JSON or YAML from logs, APIs, or colleagues into something diffable.
- Checking whether a snippet is even syntactically valid before pasting it into a codebase.
- Reformatting HTML email templates that arrived with 14 levels of inconsistent indentation.
Notes & Gotchas
- Treat this as a quick formatter, not a build step - commit a .prettierrc so your repo stays consistent.
- Minified input is legal input: Prettier reconstructs structure from the AST, not from the original spacing.
- If output surprises you, check the language tab first - formatting JavaScript as CSS will not parse.
- Errors shown are genuine syntax errors with positions; that makes the tool a fast sanity check before a commit.
Frequently Asked Questions
Is this the same Prettier as the npm package?
Yes - it is Prettier 3's official standalone build running in your browser, using the same parsers and default options, including a 100-character print width.
Can I configure quotes, semicolons, or print width?
Not here; the tool runs Prettier's defaults deliberately, so output is predictable. For project-specific style, run Prettier locally with your .prettierrc.
Does my code get uploaded anywhere?
No. Parsing and printing happen entirely in your browser. The formatter and its language plugins are downloaded to your browser, but your code never leaves the page.
Why does formatting fail on my snippet?
Prettier must fully parse input before it can print it, so any syntax error - a stray bracket, an unclosed string - stops formatting. The error text includes the line and column to fix.