JSON tools
Format, minify, and validate JSON text locally with the browser’s JSON parser.
Inputs stay in your browser
Interactive tool
Enable JavaScript to use the interactive controls. The guide below is available without JavaScript.
JSON tools format valid JSON with two-space indentation, minify it by removing insignificant whitespace, and validate syntax by parsing the input. Formatting and minifying change presentation, while validation determines whether the text follows JSON grammar.
When to use this tool
- Make a compact API response easier to read while debugging.
- Minify a valid configuration snippet before storing or transmitting it.
How to use
- Paste or type JSON into the input area.
- Choose Format for indentation or Minify for compact output.
- If parsing succeeds, review and copy the result; otherwise read the local parser error.
Example
Format an object
Input {"active":true,"count":2} becomes a multi-line object with two-space indentation in Format mode.
How it works
- The implementation calls JSON.parse for validation and JSON.stringify for output. Object member order is preserved as returned by the JavaScript parser, but JSON semantics do not rely on visual whitespace.
Limits and notes
- Comments, trailing commas, unquoted property names, NaN, and Infinity are not valid JSON and are rejected.
- Parsing can normalize number representation, and extremely large integers may lose precision in JavaScript numbers.
Frequently asked questions
Does formatting change the JSON data?
For valid JSON values it changes whitespace and indentation, not the parsed value. Number precision limits of JavaScript still apply.
Is minified JSON encrypted or compressed as a file?
No. Minification only removes insignificant whitespace; the text remains readable and is not encryption or general-purpose compression.
Is the pasted JSON uploaded?
No. This implementation parses and renders the text in the current browser.
References
Related tools
Send tool feedback
The message includes page context only, never tool input or results.
Send tool feedback