JSON formatter & validator. Errors down to the column.
Files never leave your browser. Nothing is uploaded.
Strict JSON, parsed on your device
Paste JSON or drop a .json file (up to 15 MB): the parser checks it against strict-JSON rules, pretty-prints with your choice of 2-space, 4-space or tab indent, and can sort keys alphabetically. Parse errors show the exact line and column with a caret under the broken character. One click minifies, escapes a document for embedding inside another JSON string, or unescapes a quoted string back to raw text, and a foldable tree view shows per-node key and item counts. Everything runs locally, so it even keeps working offline.
How to use the JSON Formatter
This formatter checks JSON against the strict standard, then pretty prints it, minifies it, sorts its keys or shows it as a foldable tree. It uses your browser's own JSON parser, and when the parse fails it points to the exact line and column of the problem. It is for developers and anyone reading API responses, config files or exported data.
Step by step
-
Paste or load your JSON
Paste into the Input JSON box, or drop a file on the Load .json button (or click it to browse). Files up to 15 MB are accepted. Press Load sample to try it with a small example. The Tab key inserts two spaces inside the box instead of leaving it.
-
Watch the status pill
As you type, the pill above the Result pane checks the text. It shows Valid with a count, or Error with the line and column, without changing what you typed.
-
Format it
Press Beautify for indented output, Minify for a single line, or Validate to check it and show the indented version. Choose 2 spaces, 4 spaces or Tab from the indent menu, and tick Sort keys to order every object's keys alphabetically.
-
Fix any error
If the JSON is invalid, the Result pane shows the browser's message, the line and column, and the lines around it with a caret under the character where parsing stopped.
-
Explore the structure
Press Tree view to see the data as a tree. Click any object or array row to fold or unfold it. Press Tree view again to return to the text output.
-
Take the result with you
Press Copy to copy the result, or Download .json to save it as formatted.json. Clear empties both panes.
Reading the result
- For an object, the count in the status pill is the total number of keys at every level, followed by the size of your input. Load sample reads 21 keys · 404 B. For an array, it is the number of top level items.
- In the text output, keys, strings, numbers and punctuation are colored differently so the structure is easy to scan.
- An error such as {"a":1,} with a trailing comma reports line 1, column 8: the parser expected another key after the comma and found the closing brace instead.
- In Tree view, every object shows how many keys it has and every array how many items, before you unfold it.
Tips and common mistakes
- Download .json always saves the indented version, even after Minify. To keep the minified text, use Copy.
- Comments, trailing commas, single quotes and unquoted keys are not valid JSON. They are the most common reasons a config file fails here.
- Escape turns the whole input into one quoted JSON string so it can sit inside another JSON value. Unescape does the reverse and only works when the input is a single quoted string.
- Sort keys never reorders arrays, because array order carries meaning. Sorting two API responses before you compare them removes differences that are only key order.
- If an object repeats a key, only the last value survives formatting. Very large whole numbers, such as 64 bit IDs, can lose their last digits because the browser stores every number as a standard double.
Privacy and limits
Parsing and formatting happen in your browser. Nothing you paste or load is uploaded or saved, so it is safe for JSON that holds keys or customer data. The file loader stops at 15 MB; pasted text has no fixed limit, but the input box slows down with very large documents.
One toolbar, every JSON chore.
Frequently asked questions.
Is the JSON I paste sent anywhere?
What does “Sort keys” do?
What's the difference between Escape and Unescape?
How do you find parse errors?
Why no JSON5 / JSONC support?
What's the maximum size?
Published · Last updated .