JSON Formatter

What you get

How it works

  1. Paste your JSON into the box.
  2. Press Format.
  3. Get the indented form and the one-line form — or the line and column where it breaks.

Worth knowing

Why the line and the column

The message the browser's engine throws is worded differently in every browser, often says nothing at all about where the problem is, and when it does give a position it gives a count of characters from the start of the file — a number no editor asks you for. This tool reads the document itself and gives the line and the column, which is what you need to get there.

What formatting does not change

Only the spaces and the line breaks change. Numbers and text values are copied exactly as they were written, so a very long whole number keeps all its digits and a value written with a backslash stays written that way. If an object carries the same name twice, both stay — nothing is dropped along the way.

Frequently asked questions

Does my JSON reach the server?

Yes, to be checked. It never goes into the page address, though, so it does not appear in the address bar or in your browsing history, and nothing is kept once the check is done.

Why does the error here look different from the one in my editor?

Because it is not the engine's message, it is this tool's own. Engines word the same mistake differently from one browser to the next, so the page reads the document itself and gives the line and the column.

Does formatting change my numbers?

No. Values are copied exactly as you wrote them, so a very long whole number does not lose its last digits — only the spacing and the line breaks change.

Why is a comma before the closing brace an error?

Because JSON does not allow it, even though many programming languages do. It is one of the commonest mistakes, so the page names it outright rather than calling it an unexpected character.

Related tools