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.
JSON Formatter workspace
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.
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
Case Converter
Switch text between sentence, title, upper, lower, camel and kebab case.
Free toolWord Counter
Count words, characters, sentences and paragraphs as you type.
Free toolUTM Builder
Build clean campaign URLs with UTM parameters for analytics.
Comparison