JSON Formatter

Paste JSON, press Format, and read it in clean indented form. If something is wrong, you get the line and column of the first mistake.

The work happens in your browser. Your data is not sent to a server, so it is safe to use with private payloads.

How it works

The tool reads your text with the same JSON parser your browser uses. If it reads cleanly, it writes the data back out with the spacing you picked: two spaces, four spaces or tabs. Minify writes it back with no extra spaces at all.

“Sort keys” puts the keys of every object in alphabetical order, at every level. That makes two versions of the same data easier to compare. Arrays keep their order because the order of a list carries meaning.

When the text is not valid JSON, the tool scans it to find the first spot where it breaks and reports the line and column. The usual causes are a trailing comma, single quotes instead of double quotes, an unquoted key, or a missing bracket.

Worked example: Fixing a trailing comma

The text {"name":"Ada","tags":["a","b",]} fails because of the comma after "b". The tool points at that spot. Remove the comma and the JSON formats cleanly.

Frequently asked questions

Is my JSON uploaded?

No. Formatting happens in your browser. Nothing leaves your device.

Why does JSON need double quotes?

The JSON standard only allows double quotes around keys and text values. Single quotes and unquoted keys work in some programming languages but are not valid JSON.

Can JSON have comments?

No. Standard JSON does not allow comments. Remove them before formatting.

What is the difference between format and minify?

Format adds line breaks and indentation so people can read it. Minify removes all optional spaces so the file is as small as possible.

Does sorting keys change my data?

It changes the order of keys inside objects, which does not change the meaning. Most programs treat objects as unordered, but check yours if order matters.

Related tools

Content last reviewed 2026-10-13.