JSON formatter and validator
Paste JSON to beautify it with 2 spaces, 4 spaces or tabs, or minify it to one line. If it is not valid, you see the exact line and column and a plain reason. Everything runs in your browser.
Everything runs on your device. Nothing you add or type is sent to any server.
How to use it
- 01
Paste your JSON into the box, or press Open file to load a .json file from your device.
- 02
Pick 2 spaces, 4 spaces, Tab or Minify. Tick Sort keys if you want object keys in sorted order. The result updates as you type.
- 03
If the JSON has a mistake, read the line, column and reason, then press Go to error to jump to that spot in your text.
- 04
Copy the result, download it as a .json file, or switch to Tree view to fold and unfold nested objects.
Error messages that tell you what to fix
Instead of a vague parse error, the validator names the usual problem: a comma after the last item, single quotes instead of double quotes, a key without quotes, a comment, a missing comma or colon, a line break inside a string, or Python-style True, False and None. It shows the line with the bad character marked, so you can fix it quickly. Columns count Unicode code points, so an emoji is one column and a Hindi matra is its own column. Go to error jumps to the exact spot.
Your numbers stay exactly as written
A formatter built on the browser's standard JSON parser turns numbers into JavaScript numbers, which quietly rounds long IDs: 12345678901234567890 becomes 12345678901234567000. This tool keeps every number character for character, so formatting never changes your data. Text in any language is kept as it is, and escapes like \u0928 are written as the real character.
Duplicate keys, sort keys and tree view
If an object has the same key twice, the tool keeps both and warns you, because many programs silently keep only the last value. Sort keys orders keys by character code at every level (A–Z before a–z), which makes two versions of a file easier to compare. Arrays keep their order. Tree view shows the structure with item counts; open a branch with a click or with Enter on the keyboard.
Limits
You can paste or open up to 20 MB. Very large files take a moment, and the tree shows 200 items at a time. Nesting deeper than 1,000 levels is reported as an error. The tool checks standard JSON only, so JSON5 and files with comments are reported as invalid.
Frequently asked questions
Is my JSON uploaded anywhere?
No. Parsing and formatting happen on your device. Nothing you paste or open is sent to a server or stored.
What does minify do?
It removes all spaces and line breaks between values, giving the smallest valid JSON on one line. Spaces inside strings are kept.
Can it fix my JSON automatically?
No. Automatic fixes can guess wrong and change your data. The tool shows exactly where and why the JSON is invalid so you can fix it yourself.