JSON Formatter and Validator

Developer·Free · in browser

JSON Formatter and Validator

Format, validate and minify JSON in your browser. Get the exact line and column of a syntax error instead of a vague parse failure.

JSON Formatter and Validator
All tools

A JSON formatter parses raw JSON and re-prints it with consistent indentation, or minifies it to strip every byte of whitespace. If the JSON is invalid it reports the exact line and column of the failure instead of a vague parse error.

Runs entirely in your browser · no signup · nothing is uploaded · updated 2026-08-29

How to use it

  1. 1.Paste raw JSON into the editor.
  2. 2.Choose an indent, or minify to strip every byte of whitespace.
  3. 3.Invalid JSON reports the exact position of the problem so you can fix it.

Why JSON fails to parse

Almost every parse error is one of these. JSON is far stricter than JavaScript object syntax.

InvalidValidWhy
{'a': 1}{"a": 1}Strings and keys must use double quotes
{a: 1}{"a": 1}Keys must be quoted
{"a": 1,}{"a": 1}No trailing commas
{"a": 'x'}{"a": "x"}No single-quoted strings
// comment(remove it)JSON has no comment syntax
{"a": undefined}{"a": null}undefined is not a JSON value
{"a": 01}{"a": 1}No leading zeros on numbers
{"a": .5}{"a": 0.5}A number needs a leading digit
{"a": NaN}{"a": null}NaN and Infinity are not valid JSON

Frequently asked questions

Is my JSON uploaded anywhere?

No. Parsing and formatting run in your browser with the native JSON API. Nothing is sent to a server.

Why does my JSON fail to parse?

Almost always one of three things: a trailing comma, single quotes instead of double quotes, or an unescaped newline inside a string. JSON allows none of them.

What indent should I use?

Two spaces is the common default for config and API payloads. Use minified output for anything you transmit - it is usually 15 to 30% smaller.

Does formatting change my data?

No, but key order is preserved and duplicate keys collapse to the last value, which is standard JSON.parse behaviour.

What is the difference between JSON and JSON5?

JSON5 allows comments, trailing commas, single quotes and unquoted keys. It is convenient for config files and rejected by every standard JSON parser, including this one.

Can JSON have comments?

No. The specification has no comment syntax. Config formats that appear to allow them (tsconfig, VS Code settings) use JSONC, a superset their own parsers handle.

Why do my large numbers change when formatted?

JavaScript parses all numbers as 64-bit floats, so integers above 2^53 lose precision. If your API returns large IDs, have it send them as strings.

How do I format JSON from the command line?

Pipe it through jq: curl -s url | jq . formats and colourises. Node also has it built in: node -e "console.log(JSON.stringify(require('./f.json'),null,2))".

The guide behind this tool

Tools that pair with this one

Built something?

RankCert is a weekly launch board where products rank on domain control we verify ourselves - not upvotes. Listing is free and the link is dofollow whether or not you display our badge.