JSON formatter · validator · minifier
Expand JSON that arrived on one line into readable form, or compress it back to one line. A syntax error is pinpointed to the line and column, and common slips such as unquoted keys and trailing commas can be repaired.
🔒 What you type is never sent anywhereTo turn JSON into a table (CSV, Excel) or back, use CSV · JSON · Excel converter; to see what changed between two JSON files, format both and paste them into compare text.
Why API responses and config files should not go to a random site
The moment you need to format JSON is usually the moment you are looking at an API response, a config file, a log,
or a request body with a token in it — data that often contains user records or secret keys. Most "JSON formatter" sites post your input to a server,
and some wrap it in analytics scripts. This page uses only the browser's own JSON.parse and JSON.stringify. It keeps working offline,
and a refresh clears the input.
What "repair common slips" does
Strict JSON needs double quotes around keys, allows no comma after the last item and no comments. Text copied from JavaScript or a config file often breaks
those rules. With the option on, the page removes trailing commas, quotes bare keys, turns single quotes into double quotes and strips
// and /* */ comments before parsing again. Nothing inside string values is touched. When a repair was needed the result says
"Valid after repair", so switch the option off when you need to know whether the original is strictly valid.
Frequently asked questions
Is my JSON sent to a server?
No. Formatting and validation run inside your browser and nothing is transmitted. It works with the internet switched off, and nothing is stored — a reload clears it.
How do I read the error position?
"Line 3, column 14" means everything up to that point parsed correctly. The problem is usually right there or in the item just before it — a missing comma, quote or bracket. The output box shows that line with a caret under the position.
Large numbers come out changed
JavaScript keeps integers exact only up to 2^53 (about 9 quadrillion). Longer IDs may lose their last digits. Store such values as strings in the source; this page warns when it sees a number that could be affected.
Does the key order change?
With "Keep order" the original order is preserved. "Alphabetical" sorts the keys of every object at every level. Arrays are never reordered.
Non-ASCII characters show as \uXXXX — or I want them to
By default characters are kept as they are. Turn on "Escape non-ASCII" when a legacy system needs pure ASCII. The other way round, \uXXXX escapes in the input are turned back into characters automatically.
How large a file can it handle?
Tens of megabytes without trouble; beyond that the browser may pause for a moment. Use "Open file" or drop a file onto the input box.