JSON Formatter & Validator

Pretty-print, minify and validate JSON.

Free tools that run in your browser. Nothing you type, open or create is uploaded to NerdBible or anyone else.

Paste JSON to check and format it.

Result

  

Numbers are kept exactly as written, so long IDs such as 12345678901234567890 are not rounded the way JSON.parse rounds them. If a key appears twice in one object, both are kept and shown, since that is often the bug you are looking for.

How to use it

  1. Paste JSON into the box. It is checked as you type.
  2. If it is invalid, the line and column of the first problem are shown with the line itself.
  3. Choose Format, Minify or Tree, then copy or download the result.

Questions

Why is my JSON invalid?

The usual causes are a trailing comma after the last item, single quotes instead of double quotes, keys without quotes, comments, or a missing comma between items. The error shows the exact spot.

Is my JSON sent to a server?

No. It is checked and formatted in your browser, so API responses, configuration files and tokens never leave your device.

What does sorting keys do?

It puts the keys of every object in alphabetical order, at every level. That makes two versions of the same data much easier to compare with the Diff Checker.

What is minified JSON?

The same data with every unnecessary space and line break removed. It is smaller to send and store, but hard to read, which is what Format is for.

About this tool

About the JSON formatter

API responses and configuration files often arrive as one unreadable line. Paste JSON here and it is checked as you type, then shown the way you need it.

  • Format indents it into readable, nested lines.
  • Minify strips every unnecessary space and line break for the smallest size.
  • Tree shows it as a collapsible outline, which helps with deeply nested data.

Sorting keys puts every object's keys in alphabetical order at every level, which makes two versions of the same data easy to compare in the diff checker.

Finding the error

When JSON is invalid, the line and column of the first problem are shown with the line itself. The usual causes are a trailing comma after the last item, single quotes instead of double quotes, keys without quotes, comments, or a missing comma between items.

Two details other formatters miss

Numbers are kept exactly as written, so a long ID such as 12345678901234567890 is not silently rounded, as it would be by a formatter that parses with standard JavaScript. If a key appears twice in one object, both copies are kept and shown, since a duplicate key is often the very bug you are hunting.

JSON is checked and formatted in your browser, so API responses, configuration and tokens never leave your device.

Related tools