JSON Formatter and Validator

Paste your JSON to validate it, make it readable or minify it. If there's an error, you'll see the line and column where it is. Everything runs in your browser: your text is never sent to a server.

🔒 What you type never leaves your device. Everything is calculated in your browser.

How to format JSON

  1. Paste your JSON into the input box.
  2. Choose the indentation (2 or 4 spaces, or a tab) and, if you want, sort the keys.
  3. Click “Format” to beautify it or “Minify” to squeeze it into a single line.
  4. Copy the result. If there's an error, the cursor jumps to the spot where it fails.

What a JSON formatter is for

JSON is the most widely used data format in APIs and config files. When it arrives all on one line it's hard to read: the formatter adds line breaks and indentation so you can see its structure.

It also works as a validator: if a comma is missing, there's an extra brace or you used single quotes instead of double quotes, it tells you the line and column where the JSON stops being valid.

Minifying does the opposite: it removes spaces and line breaks so the text is smaller to send or store.

Things to keep in mind

Frequently asked questions

Is my JSON sent to a server?

No. It's processed in your browser and the text never leaves your device, so you can use it with private data.

Why does it say my JSON is invalid?

The most common causes are an extra or missing comma, single quotes instead of double quotes, unquoted keys or an unclosed brace. The message shows the line and column.

What's the difference between formatting and minifying?

Formatting adds line breaks and indentation to make it easier to read; minifying removes them so it takes up less space.

Can I sort the keys?

Yes, with the alphabetical sort option. It's handy for comparing two JSON files or for getting the same output every time.

Is it free?

Yes, it's free, needs no sign-up and works right in your browser.