Skip to content
NapTools

JSON formatter and validator

Paste JSON to pretty-print it, check that it's valid or minify it for production. Errors point to the exact line and column, and your data never leaves the page.

Output

How to use: JSON formatter

  1. 1Paste your JSON into the input box, or press "Try sample" to see how it works.
  2. 2Choose Format to pretty-print, or Minify to remove all whitespace.
  3. 3Pick 2 spaces, 4 spaces or tabs for indentation.
  4. 4Copy the result or save it as a .json file.

What the validator checks

NapTools validates against the JSON standard (RFC 8259) and reports the first error with its line and column, in plain words:

  • missing or extra commas, including trailing commas
  • single-quoted strings and unquoted keys
  • unterminated strings and invalid escape sequences such as \x
  • leftover text after the JSON value, for example two objects pasted back to back

Format vs minify

Format adds line breaks and indentation so humans can read and review the data. Minify strips every unnecessary space and newline, which makes payloads smaller for APIs, local storage and config files that are shipped to users.

Common JSON mistakes

You wrote Valid JSON
{name: "Asha"} {"name": "Asha"}
{'city': 'Pune'} {"city": "Pune"}
[1, 2, 3,] [1, 2, 3]
{"ok": True} {"ok": true}

Frequently asked questions

Is it safe to paste API responses or config with secrets?

Your JSON is processed only in your browser and is never sent to any server. Still, treat secrets carefully and rotate any key you have pasted somewhere you don't control.

Why does it say "Trailing comma"?

Standard JSON does not allow a comma after the last item in an object or array. JavaScript and some config formats allow it, but JSON parsers will reject it.

Why are single quotes an error?

JSON requires double quotes around keys and string values. Replace 'name' with "name".

Does formatting change my data?

No. Formatting only changes whitespace. Keys keep their order and values are unchanged. Very large numbers beyond JavaScript's safe integer range may lose precision, as in any browser-based JSON tool.

How big a JSON file can it handle?

Several megabytes comfortably. Formatting runs as you type, so extremely large files (50 MB and above) are better handled in a code editor.