JSON Formatter
Format, validate, and minify JSON with helpful error messages
About this calculator
The JSON Formatter validates, pretty-prints, and minifies JSON. Input is round-tripped through JSON.parse, so output follows the spec exactly and Unicode is preserved; pretty mode indents with two spaces while minify strips all whitespace. It reports input and output sizes, the size change as a percentage, and a node count so you can confirm the structure parsed as expected. Parse failures surface the parser's exact error message with position information.
How to use the JSON Formatter tool
- Enter or paste your input into the field.
- Read the output — it updates instantly as you type.
- Adjust the options, if any, to fit your use case.
- Copy the page URL to share the exact result.
Common examples
- pretty {"a":1,"b":[2,3]} → 4-line indented output, 5 nodes
- minify a 41-char formatted object → {"name":"Ada","tags":["x","y"]} (−24.39% size)
- {a:1} → error: Expected property name or '}' in JSON at position 1 (line 1 column 2)
Frequently asked questions
How does the JSON Formatter tool work?
Enter or paste your input and the tool processes it directly in your browser, showing the result immediately. Nothing you type is uploaded to a server — the entire computation happens on your device.
When would I use the JSON Formatter tool?
It is handy for development, debugging, design and administration tasks — whenever you need this transformation or check done quickly without installing anything or trusting a third-party service with your data.
How reliable are the results?
The tool implements the relevant standard or specification directly, so its output matches what compliant software produces. Edge cases such as empty or malformed input are reported clearly instead of failing silently.
Can I share a specific result with someone else?
Yes. Your input updates the URL, so copying the address bar and sharing the link reopens the tool in the same state for whoever clicks it.