JSON Formatter

Formats, validates and repairs JSON in the browser. Errors are explained in plain words, one button fixes typical breakages, duplicate keys and risky numbers are caught.

Your text isn't sent anywhere: parsing, repair, and the tree all run right in the browser. Real API responses with tokens can be pasted here.

JSON holds API responses, database dumps and config files, with tokens, addresses and personal data inside. The formatter works on the text you paste in: it finds where the syntax breaks, shows the line and character, quotes the broken fragment with an arrow pointing at the exact spot, and explains the problem.

The “Repair” button does the fixing. JSON breaks in a handful of recurring ways, and almost all of them are mechanical to correct: single quotes instead of double, keys without quotes, trailing commas, comments, smart quotes pasted from Word and messengers, a Python dict with True and None, or values like NaN and undefined. After the repair the tool lists every change it made, so nothing in your text is rewritten silently.

Two cases validators stay silent about

The first is duplicate keys. The record {"a": 1, "a": 2} is formally valid, but a parser silently keeps the last value, so half the data disappears without a single warning. We find duplicates and show them with their paths.

The second is large numbers. JavaScript stores integers exactly only up to 9007199254740991; anything longer gets rounded, so an id like 9007199254740993 turns into a different number after parsing. Ids like these arrive from databases and messengers all the time, and they break exactly at the moment you “just formatted” the file. We warn about every such number and suggest passing it as a string.

A tree with paths

Large JSON is easier to read as a tree: branches collapse, and each node shows its element count. Clicking a key copies a path like $.order.items[0].sku, ready to paste into code or jq. Clicking a value copies the value itself. The tree is built lazily, so large files do not hang it.

Rate this tool

Help us get better

Other tools