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.
Warnings
Tree
Clicking a key copies its path, like $.order.items[0].sku; clicking a value copies the value itself.
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
Tell us what was missing.
Other tools
Regex Tester
Regex testing with a plain-language breakdown and hang protection
JWT Decoder
JWT parsing with fields explained and signature verification
CSV to JSON
A table to JSON with honest types and a reverse check
JSON to CSV
JSON to a table for Excel, with verification and formula protection
SQL Formatter
A readable query layout, verified against the source, with risky spots flagged
XML Formatter
Readable XML, errors explained with a hint, verified against the source
XML Validator
Markup, XSD schema, sitemap, YML and RSS rules, with the path to each error
String Escape / Unescape
Nine modes in both directions, catches double escaping