Skip to content
Merlin Tools

Code formatter

Paste messy code, pick the language, and get the Prettier-formatted version, ready to copy. All in the browser.

Genuinely free. No sign-up, no email, no limits, no cookies. We don't store the URL you analyse.

Paste your code, pick the language and press «Format».

What this tool cannot see

Formatting only touches the shape of the code (indentation, spacing, line breaks): it doesn't change behaviour and doesn't fix logic errors. Prettier runs in your browser; the code is never sent anywhere.

What it's for

Consistently formatted code is easier to read, review and maintain, and it settles a whole team on one style, no debates. This tool uses Prettier, the same engine that runs in the editors and pipelines of thousands of projects: paste the code, pick the language, and get output identical to the standard, with nothing to install.

It's part of the developer toolset alongside the JWT decoder, the Base64 converter and the Unix timestamp converter. For your design system's typography, a great tool is typescaler.com.

Frequently asked questions

Which languages does it support?

JSON, JavaScript, TypeScript, JSX/TSX, CSS, SCSS, LESS, HTML, Vue, Markdown, YAML and GraphQL. Formatting is handled by Prettier, the de facto standard of web dev, so the result is identical to what you'd get from the command line.

Is my code sent to a server?

No. Prettier is loaded and run in your browser: the code never leaves your device and isn't stored. That's why you can use it even with confidential code, unlike formatters that send everything to a server.

Does it double as a validator?

Yes, effectively. If the code has a syntax error, Prettier can't format it and shows the error message with its position: a quick way to spot an extra comma in a JSON or a missing bracket.

Can I choose the style?

Yes: you can set the indentation (2 or 4 spaces) and the maximum line width (80, 100 or 120 characters). Otherwise Prettier's defaults apply, the ones most projects converge on.