Developer Tools

JSON Formatter & Validator

Format, minify and validate JSON with clear error messages — instantly and privately.

Tool

About the JSON Formatter

The JSON Formatter & Validator runs entirely in your browser — your code and data never leave your machine. Paste, click, copy the result.

JSON is the language of APIs and config files — but one missing comma makes it invalid. Paste your JSON to validate it, prettify it with 2-space indentation, or minify it for production. Errors are reported with the exact line and character so you can fix them in seconds.

How to use this tool

  1. Paste your JSON into the input box.
  2. Click Format for readable indentation, or Minify to compress it.
  3. If the JSON is invalid, the output box shows the error message and position.
  4. Click Copy output to grab the result.

Most common JSON errors

ErrorCause
Unexpected tokenSingle quotes instead of double quotes, or a trailing comma
Property name expectedObject keys must be in double quotes
Unexpected endMissing closing brace or bracket
NaN / InfinityNot valid JSON — use null or a string

Valid JSON example

{"id": 42, "tags": ["a", "b"], "meta": {"ok": true}, "value": null}

Who is this tool for?

Developers debugging API responses, anyone editing config files (package.json, tsconfig), and analysts checking exported data.

Developer tip

Minified JSON is for machines; formatted JSON is for humans. Keep configs formatted in your repo and minify only when shipping to clients.

Frequently asked questions

No. Formatting happens in your browser with JavaScript — nothing is sent to a server.
Two spaces, the convention used by most style guides and JSON files in the wild.
Check for trailing commas, single quotes, unquoted keys and comments — all legal in JavaScript but forbidden in strict JSON.

Related tools

Guides for this tool