JSON Formatter

Format, check and minify JSON, with the exact line of any mistake.

Made in your browser — nothing is uploaded

About JSON Formatter

Paste JSON to check it and format it with 2 or 4 spaces or tabs, or minify it to one line. A mistake is shown with its line and column and selected in the box, so it is quick to fix. Sort keys A to Z if you like. The JSON stays in your browser, so API keys and private data are never sent anywhere.

How JSON Formatter works

JSON Formatter reads your text with the browser's own JSON parser. When it is valid, it is written back with the indentation you choose — 2 or 4 spaces or tabs — or minified to a single line, optionally with every object's keys sorted A to Z.

When it isn't valid, the message gives the line and column of the problem and selects that spot in the box. Your JSON never leaves your browser, which matters for API responses, tokens and personal data.

When to use JSON Formatter

  • Read an API response or a config file that arrives as one long line.
  • Find the mistake in JSON that an app refuses to load.
  • Make JSON smaller (minify) before sending or storing it.

How to use JSON Formatter

  1. Paste your JSON. Into the top box; it's checked as you type.
  2. Choose the output. 2 spaces, 4 spaces, tabs or minify; sort keys if you like.
  3. Copy or download. Press Copy, or download a .json file.

Common JSON mistakes

Trailing comma
[1, 2, 3,] — remove the comma after the last item.
Single quotes
{'a': 1} — JSON needs double quotes: {"a": 1}.
Unquoted keys
{a: 1} — keys must be in double quotes.
Comments
// and /* */ aren't allowed in JSON.

Frequently asked questions

Why does it say my JSON is not valid?

Common causes are a comma after the last item, single quotes instead of double quotes, or a missing bracket. The message shows where the problem was found.

Can it convert JSON to Excel?

Yes — use JSON to Excel & CSV for arrays of records.

Is what I type private?

Yes. JSON Formatter runs entirely in your web browser, so what you type is never sent to us or stored anywhere.

Guides