JSON formatter and validator

Paste JSON to pretty-print or minify it, check that it is valid, and browse it as a collapsible tree. If it is invalid you get the exact line, column and a plain-English reason.

  • ๐Ÿ”’ Runs on your device
  • โค’ 0 bytes uploaded
  • โœ“ Free, no sign-up, no watermark
Loading the toolโ€ฆ

How to use JSON Formatter

  1. Paste your JSON or open a .json file.
  2. Choose 2 spaces, 4 spaces, tab or Minify.
  3. If there is an error, press Go to the error to jump to it.
  4. Copy or download the result, or switch to Tree view to explore it.

About JSON Formatter

JSON (JavaScript Object Notation, RFC 8259) allows objects, arrays, double-quoted strings, numbers, true, false and null. It does not allow comments, trailing commas, single quotes or undefined; those are the most common reasons JSON copied from JavaScript code fails to parse.

String values are written out exactly as in your input, so escapes such as \u00e9 are preserved.

Is it private?

Yes. JSON Formatter runs entirely in your web browser: what you type into it is never sent to Nolo or anyone else, and the page's security policy only allows it to talk to nolotools.com. The site sends only two small things: the words typed in the optional search box, to find a tool, and, the first time you use a tool on a page, that tool's name for an anonymous daily count of tool use (nothing about you, your files or what you typed). Nothing is stored either: close the page and it is gone. How Nolo works.

Questions and answers

Is my JSON sent to a server?

No. Everything runs in your browser and your JSON never leaves your device. The page is not allowed to talk to any other site, so it is safe to use with real data and secrets.

Does it change big numbers?

No. Many formatters run JSON.parse, which rounds integers above 9,007,199,254,740,991 (for example IDs like 12345678901234567890). This tool keeps every number exactly as written.

How does it find errors?

It reads the JSON with a strict parser that stops at the first problem and reports the line, the column and what was expected, such as a missing comma, a trailing comma or single quotes.

Can it read JSON with comments?

Yes. Turn on "Allow comments and trailing commas" for JSONC files such as tsconfig.json or VS Code settings. The output is always strict JSON without comments.

What does Sort keys do?

It orders the keys of every object alphabetically, at every level. Array order is never changed. This makes two JSON files easier to compare.

Does it warn about duplicate keys?

Yes. Duplicate keys are valid syntax but most programs keep only the last value, so they are listed. The formatted output keeps all of them.