SuperDevTools

JSON formatter and validator

Paste some JSON, drop a .json file or click "Open a file".
Output
JSON size
0
Output size
0
Keys
0
Depth
0

Everything happens in your browser: your JSON is not sent anywhere and not stored anywhere. You can paste sensitive data.

A JSON formatter and validator that runs in your browser

JSON is the text format behind most web APIs, config files and app exports. It has only six kinds of values: object, array, string, number, boolean and null. For example: {"city":"Chicago","zips":[60601,60602],"subway":true}.

Paste your text into "Your JSON", drop a .json file onto the box or click "Open a file". Validation runs as you type: you get either "Valid JSON." or a message with the line, the column and the cause, plus an extract where the offending character is highlighted. "Go to the error" puts the cursor right on it.

How to use it

  1. Pick the "Output": "Format", "Minify" or "JSON → CSV".
  2. Set the "Indentation" (2 spaces, 4 spaces or tab) and tick "Sort keys (at every level)" if you need it.
  3. Switch from "Text" to "Tree" to explore the data.
  4. Click "Copy" or "Download". The "JSON size", "Output size", "Keys" and "Depth" boxes give you the statistics.

Syntax rules and common errors

JSON is stricter than JavaScript. Keys and strings take double quotes, items are separated by commas, and nothing may follow the last item.

WrittenProblemCorrect
{"a":1,}trailing comma{"a":1}
{"a":'x'}single quotes{"a":"x"}
{a:1}unquoted key{"a":1}
{"a":1} // notecomments not allowed{"a":1}
{"a":NaN}NaN and Infinity do not exist{"a":null}

For {"a":1,} the tool reports "line 1, column 8: extra comma before "}"". Column 8 is the closing brace that shows up where a key was expected. The tool works out positions itself, so the answer is the same in every browser, unlike the raw messages browsers print.

The "Gentle repair" box fixes the four slips people make when they write JSON by hand: trailing commas, single quotes, unquoted keys, and // or /* */ comments. Every fix is listed with its line number. So {a:'x', /*c*/ b:[1,2,],} becomes {"a":"x","b":[1,2]} after six fixes. NaN and other mistakes are still reported: that call is yours.

Beautify or minify: what each is for

Formatting (often called beautifying) adds line breaks and indentation so you can read an API response or review a config file. Minifying does the opposite: everything sits on one line with no extra spaces, to cut the weight of a payload sent over the network. The repaired example above is 19 bytes minified and 41 bytes formatted with 2 spaces. Sorting keys makes it easy to diff two versions of the same file.

"JSON → CSV" turns a flat array of objects, such as [{"item":"Coffee, 12 oz","price":7.99}], into a table for a spreadsheet. Cells that contain a comma or a double quote are wrapped in quotes, following the usual CSV rule, so the column layout survives.

Reading the tree view and paths

Each object shows how many keys it holds and each array how many items. Colors tell strings, numbers, booleans and null apart. Nodes open one at a time, 200 children at a time, which keeps the page responsive even with a file of several megabytes. Click a key to see its path, for instance $.users[1].name: the name of the second user, since arrays start at 0. "Copy path" puts it on the clipboard for a script or a JSONPath query. The "Search keys and values" box lists the matching nodes, and clicking a path opens the tree down to it.

Privacy: everything is processed locally

Nothing leaves your computer: no upload, no copy of the content kept anywhere. You can paste an API response that contains tokens or a customer export. Only your settings (indentation, separator, ticked boxes) are remembered by the browser.

Frequently asked questions

Why does my long ID change value?

Browsers read numbers with limited precision: above 9,007,199,254,740,991 (2^53 − 1), integers get rounded. 12345678901234567890 turns into 12345678901234567000. The tool shows a warning when it spots one; keep such IDs as strings.

Are accented letters and emoji kept?

Yes. The output stays in UTF-8, so "café" and "東京" are not turned into \u sequences.

How big a file can it handle?

Up to 50 MB when you open a file. A 5 MB file formats in under two seconds on a recent computer.

What happens to duplicate keys?

JSON tolerates them, but only the last value is kept when formatting: {"a":1,"a":2} becomes {"a":2}.