JSON Formatter

37 tools

Format, minify and check JSON in the browser.

Free to use with no account. JSON, passwords, hashes, 2FA and text tools run entirely in your browser.

JSON Formatter

Format, minify and check JSON in the browser.

Free

About

Paste JSON and get it indented, or collapsed back to one line. Broken input is reported with the position that failed rather than silently repaired, because a formatter that guesses what you meant is worse than one that stops.

How to use

Paste the text and choose format or minify. Invalid JSON produces a parse error instead of output, and the error points at where the parser gave up.

Two shapes, one document

Indented JSON exists for people and minified JSON exists for wires. Switching between them changes nothing about the content, which is why a formatter can be trusted with data it does not understand. The practical use is unfolding the single line an API returned so the nesting becomes visible, then collapsing an edited version back to paste into a request.

Where the parser stops

A parse error names the first place the text stopped being valid, which is not always where the mistake was made. An unclosed bracket near the top surfaces as a failure at the very end. When the reported position looks arbitrary, check the structure above it rather than the character it named, and format progressively smaller fragments to narrow the region.

Valid is not the same as correct

Parsing proves the syntax holds. It says nothing about whether a required field is present, whether a number arrived as a string, or whether the shape matches what your API promised. Those are schema questions and they need a schema validator. Plenty of production bugs sit inside JSON that formats beautifully.

Large documents and the browser

Everything happens in the tab, so a very large payload is limited by the memory that tab has. A few megabytes is fine and a very large export will make the page slow before it fails. For files at that scale, a command line tool is the better instrument, and it also avoids putting the whole document into a text box.

FAQ

Does my data leave the page?

It does not. The parsing runs in your browser, which is the reason this is usable on an API response containing real customer records.

What is the difference between format and minify?

Formatting adds indentation and line breaks so a person can read it. Minifying strips every optional space so a machine can move it. The data is identical either way.

My JSON has comments and it will not parse.

Comments are not part of JSON, although several config formats allow them anyway. Strip them, or use a parser built for the relaxed variant your tool expects.

How do I find the error it is complaining about?

Work from the reported position backwards. A trailing comma before a closing brace, a single quote where a double belongs, and an unescaped quote inside a string account for most of them.

Related tools

JSON Formatter - Format, Minify and Validate in Browser