Free tool

JSON formatter, check it, fix it, read it.

Paste JSON or open a .json file. It is checked and laid out with colours at once; a mistake shows the exact line and column with an arrow under it. Fix repairs the usual problems in JSON copied from code or an AI answer: comments, trailing commas, single quotes, keys without quotes. Minify it, sort the keys, or browse it as a tree.

Input
Result

            

Comments, trailing commas, single quotes, keys without quotes, and True, False or None from Python.

Options

Tree

Cmd or Ctrl and Enter formats.

Your JSON is read in your browser. It is never uploaded, so API keys and private data stay with you.

The rules

What valid JSON needs.

01 / Quotes

Double quotes only

Keys and text values go in "double quotes". Single quotes and keys without quotes are JavaScript, not JSON.

02 / Commas

None at the end

A comma goes between items, never after the last one in a list or an object.

03 / Values

A short list

Text, numbers, true, false, null, lists and objects. No comments, no undefined, no NaN.

Questions

Good to know.

Is it safe to paste JSON with API keys or personal data?

On this page, yes: the JSON is checked and formatted by your own browser and never leaves the tab. That is not true of every online formatter, so check before you paste secrets elsewhere.

What does "Unexpected token" mean?

The reader met a character it did not expect at that spot, often a single quote, a comment, a missing comma between two items, or an extra comma at the end. The arrow under the line shows where it stopped; the mistake is there or just before it.

What does Fix change?

It removes comments and trailing commas, turns single quotes into double quotes, puts quotes round bare keys, and turns True, False and None into true, false and null. It never changes your values. Look over the result, since it guesses what was meant.

How large a file can it handle?

Files of several megabytes format in a moment. Above about 1.5 MB the colours are left off to keep the page quick, and the tree shows the first 5,000 items.

What is minified JSON?

The same data with every space and line break that is not needed taken out, so it is smaller to send or store. Format turns it back into readable lines.