JSON formatter and validator

Paste your JSON to indent it, minify it or check it. If it is broken you get the exact line and column, in plain words, and a one-click repair for the usual mistakes.

  • Free
  • No sign-up
  • Runs in your browser
json-formatter
Paste some JSON on the left to format and check it.
Result

100% private — your JSON is processed in your browser and never sent to any server. Safe for API responses that contain tokens or personal data.

How it works

Paste your JSON

From an API response, a config file or a log. It is checked as you paste.

Read the result

Valid JSON is indented and colored. If it is broken, you see exactly where and why.

Copy or repair

Copy the formatted result, or let the tool repair the common mistakes for you.

Format, check and fix JSON in one place

JSON is the format most programs use to exchange data: API responses, configuration files, exports and logs. It is easy for machines and hard for people, especially when it arrives on a single line. This tool turns that line into readable, indented JSON, or does the opposite and minifies it to save space, and it tells you whether the JSON is valid at all.

Errors, explained in plain words

A typical parser says something like "Unexpected token } at position 214". Here you get the line and column, the surrounding lines with a marker under the problem, and an explanation such as "there is a comma before a closing brace". The mistakes that cause most invalid JSON are always the same ones:

  • A trailing comma after the last item.
  • Single quotes instead of double quotes.
  • Property names without quotes, as in JavaScript objects.
  • Comments, which JSON does not allow.
  • A missing comma between two items.
  • Python-style values such as True or None.

Automatic repair

When the JSON is broken but the intent is clear, the "Try to repair automatically" button fixes all of the above and tells you what it changed. It also removes the code fence that chat assistants wrap around JSON and turns curly quotes pasted from a document into normal ones. Review the result: a repair is a reasonable guess, not a guarantee.

It does not damage your data

Many formatters parse numbers into ordinary floating-point values, which quietly rounds very large numbers such as long identifiers. This tool keeps every number exactly as you wrote it. It also warns you about repeated keys, which are technically accepted but usually mean a mistake, because most programs keep only the last value.

Safe for sensitive data

API responses often contain tokens, emails or customer data. Because the work happens in your browser, nothing is sent to a server, and you can use the tool without giving that information to anyone.

Frequently asked questions

Is my JSON sent to a server?
No. It is formatted and checked in your browser and never leaves your device. It is safe to use with responses containing tokens or personal data.
Why does it say my JSON is invalid when it works in my code?
Some languages accept things that strict JSON does not, such as comments, single quotes, unquoted keys or trailing commas. The error message tells you which one it is, and the repair button can fix them.
What is the difference between formatting and minifying?
Formatting adds line breaks and indentation so people can read it. Minifying removes all unnecessary spaces to make the file smaller. Both keep exactly the same data.
Does it change my numbers?
No. Numbers are kept exactly as written, so long identifiers are not rounded, which some other tools do.
Can it sort the keys?
Yes, tick "Sort keys A → Z". It is handy for comparing two JSON files, because the same data then appears in the same order.
How large a file can it handle?
Several megabytes work fine on a computer. Above about 1.5 MB the colors are skipped to keep it fast, and the tree view is limited to a few thousand nodes.
What does the tree view do?
It shows the structure as folders you can fold and unfold, which is the fastest way to explore a large response without scrolling through thousands of lines.