Skip to content
Price watch
Checked Nov 25, 2026

Developer tool · Free · Runs in your browser

JSON Formatter

Validate, pretty-print or minify JSON in your browser. Nothing you type is uploaded or stored.

Updated November 25, 2026

JSON Formatter workspace

studio / json-formatter
ValidStatus
0Keys
0Max depth
0 BOutput size

Privacy: this tool runs entirely in your browser. IdeaTruss does not receive, log or store your input.

How it works

The formatter parses your text with the browser's built-in JSON parser, then writes it back out. Pretty-print uses the indent you choose; minify removes all whitespace outside strings. With "Sort keys" on, every object is rebuilt with keys in alphabetical order, at every depth.

output = JSON.stringify(sortKeys ? sorted(JSON.parse(input)) : JSON.parse(input), null, indent)

Worked example

Input {"b":1,"a":[1,2]} with sort keys on and minify gives {"a":[1,2],"b":1}: 2 keys, depth 2, 17 bytes.

Limits and caveats

  • Comments, trailing commas and single quotes are not valid JSON and will be reported as errors.
  • Very large numbers beyond 2^53 lose precision, a limit of JavaScript numbers.
  • Files of several megabytes work, but the page may pause while parsing.

Frequently asked questions

Is my JSON sent to a server?

No. Parsing and formatting run in your browser with the built-in JSON parser. Nothing you paste is uploaded, logged or stored by IdeaTruss.

Why does valid-looking JSON fail?

The most common causes are trailing commas, single quotes around keys or strings, comments, and unquoted keys. JSON allows none of these. The error line points to where the parser stopped.

What does minify do?

Minify removes every space and line break that is not inside a string. The data stays identical, but the file gets smaller, which helps when you paste JSON into configs or API calls.

Can I sort keys?

Yes. Tick "Sort keys" and objects are rebuilt with keys in alphabetical order at every depth. Arrays keep their order because array order carries meaning.

Related tools and guides