How to use JSON formatter
- 1
Paste your JSON into the Input box, or press "Load an example" to try it out.
- 2
Choose Format (pretty-print) or Minify, and pick 2 spaces, 4 spaces or tabs.
- 3
Read the result. Valid JSON appears on the right; errors show the exact line and column.
- 4
Copy the output or download it as a .json file.
What this tool does
The JSON formatter turns compact or messy JSON into neatly indented, readable text, and checks that it is valid while you type. Minify does the opposite: it removes all whitespace so the JSON is as small as possible for sending over a network or storing in a config value.
Features
- Live validation. The result updates as you type, with a clear message when something is wrong.
- Exact error location. Line and column numbers point to the first invalid character.
- Indentation choice. 2 spaces, 4 spaces or tabs.
- Sort keys. Alphabetical keys at every level, ideal before comparing two files.
- Minify. Strip whitespace for the smallest possible output.
- Copy or download. One click to the clipboard, or save as a
.jsonfile.
Limits
- Strict JSON only: comments, trailing commas and single-quoted strings are reported as errors, not silently fixed.
- Numbers beyond JavaScript's safe range (larger than 2^53) can lose precision when formatted.
- Duplicate keys are allowed by the parser; the last value wins in the output.
Where your text is processed
This tool works in your browser: what you type or paste is processed on your own device, so it isn't sent to our server for this tool. Some other tools on UtiloNest do use our server, and their pages say so.
Frequently asked questions
Where is my text processed?
In your browser. This tool works on your own device, so what you type isn't sent to our server for it.
How does the validator find the error position?
When parsing fails, a strict RFC 8259 scanner walks the text and stops at the first character that breaks the rules. It reports the line and column and explains the problem, such as a trailing comma, a missing colon, single quotes or an unterminated string.
Why is my JSON invalid when it works in JavaScript?
JSON is stricter than JavaScript object syntax. Keys must use double quotes, strings can't use single quotes, trailing commas aren't allowed, and values like undefined, NaN or comments are not part of JSON.
What does "Sort keys A–Z" do?
It orders the keys of every object alphabetically, at every level, without changing arrays. Sorted output is easier to scan and makes two JSON files much easier to compare in a diff checker.
Is there a size limit?
There's no fixed limit. Files of several megabytes format in a moment on most computers. Very large files (tens of megabytes) may make the page slow on phones, because everything runs on your device.