Code Formatter and Minifier
Formatting happens in your browser — the code is never sent to a server or stored anywhere. Automatic fixing works for JSON only, where the errors are mechanical. For every other language we point at the error but never rewrite your code.
About the tool: formatting, minifying and validating code
This tool replaces eight separate tabs. It turns code into a readable shape, squeezes it down for publishing and shows exactly where the syntax error is — with a line number and a position. It supports JSON, JavaScript, CSS, HTML, XML, PHP, YAML and Markdown. There are no third-party ads, no size limits and no sign-up.
All the work happens in your browser — the code is never sent to a server or stored anywhere. For code this matters: it often carries keys, passwords and customer data.
Key benefits of the tool:
The language is detected automatically: paste the code — the tool recognises it by its structure. If the guess is wrong, you can pick the language by hand.
An error with coordinates: instead of a blunt "invalid" you get the parser message and the exact spot — line and column.
A proven formatter, not a homemade one: Prettier works under the hood — the very same one that sits in the editors of millions of developers. The result matches what your own IDE would produce.
Formatting or minification?
Formatting
This mode lays out indentation and line breaks so that the code is comfortable to read. It helps when you have received an API response as one long line, inherited someone else's file or simply want to see the structure. The indent is up to you: two spaces, four or a tab.
Minification
This mode strips everything unnecessary — spaces, line breaks, comments — so that the file weighs less. You need it before publishing to a site, not while working with the code.
Minification is available for JSON, JavaScript, CSS, HTML and XML. For PHP, YAML and Markdown it is deliberately absent: squeezing PHP brings no gain and breaks debugging, while in YAML and Markdown indentation and line breaks are not decoration — they are the syntax.
What exactly does the tool fix on its own?
Being precise here matters — automatic fixing of code is a dangerous thing.
For JSON the fixing genuinely works. Its errors are almost always mechanical, so the tool repairs them silently and always shows a list of what it changed:
Comments are removed: JSON has none, even though editors often let you write them.
Trailing commas before a closing bracket are removed: most often they are left behind after deleting the last item.
Single quotes are replaced with double ones, and unquoted keys are wrapped in quotes: that is how JSON gets copied out of JavaScript.
True, False, None — Python literals, which that language writes with a capital letter. They are replaced with
true,false,null.NaN and undefined — JavaScript literals that do not exist in JSON at all. They are replaced with
null.Curly quotes are replaced with straight ones: they appear after copying through Word or a messenger.
Python and JavaScript are mentioned here not as languages the tool formats, but as the sources of the text: that is where people copy from what they believe is JSON. Python prints a dictionary in its own syntax rather than through json.dumps() — and the result is almost JSON, yet invalid. The tool does not format Python.
For every other language there is no fixing, and that is a deliberate decision. Repairing an arbitrary syntax error in JavaScript or PHP means guessing what exactly the author meant. Getting it wrong is easy and the price is high: the tool would quietly change the logic of your code. So for JS, PHP, CSS, HTML and XML we point at the error and leave the decision to you.
A few practical tips
An API response on one line: paste it as is and press "Format" — the language will be detected on its own.
The error may not be on the line reported: the parser tells you where it noticed the problem. An unclosed bracket usually shows up well below the real spot, so look above the position given.
Minified code is not for editing: compress as the last step and always work with the formatted original.
Secrets in code: although everything is processed in your browser, make it a habit never to paste live keys and passwords into any online tool.