JSON Formatter & Validator

Format messy JSON into clean, indented, readable JSON — and when it's broken, get the error located by line and column. Nothing you paste leaves your browser — this tool runs entirely on your device.

Share as link: your text is compressed and stored inside the link itself, after the #. That part of a web address is never sent to our server — we never see it, log it, or store it. Anyone with the link can read the text, and the link can never be taken down or revoked, because no copy exists on a server. Don't share secrets this way. Some chat apps mangle long links.

What this tool does

JSON arrives ugly: minified into one line by an API, hand-edited until the commas are wrong, or copied out of a log with a trailing comma that strict parsers reject. This formatter parses your JSON with the browser's real JSON parser — the same rules every other tool obeys — and re-prints it with consistent two-space indentation, one key per line. If parsing fails, the validator reports the parser's error and, where the browser provides a position, pinpoints the line and column with a snippet of the offending area, which turns a twenty-minute hunt for a missing quote into a ten-second fix. API responses, config files, webhook payloads and data exports all get the same treatment.

How to use it

  1. Paste your JSON into the box above.
  2. Click “Format JSON” for a clean reprint, or “Validate only” to check without reformatting.
  3. If there's an error, jump to the reported line and column, fix it, and run it again.

Example

Before:

{"user":{"name":"Ana","roles":["admin","editor"],"active":true}}

After:

{
  "user": {
    "name": "Ana",
    "roles": [
      "admin",
      "editor"
    ],
    "active": true
  }
}

Good to know

The most common JSON killers: trailing commas after the last item, single quotes instead of double, unquoted keys, and comments — strict JSON allows none of them. If your data has those, it's probably JSON5 or a JavaScript object literal; the error location will show you the first offending spot. Large payloads are fine — formatting happens locally at paste speed.

Frequently asked questions

Is my JSON uploaded for validation?

No. Parsing happens in your browser with its built-in JSON parser. Paste an API payload with the network tab open and watch: nothing is sent.

Why does the validator reject my trailing comma?

Because the JSON standard does. JavaScript allows trailing commas; JSON does not, and neither do most APIs. Remove it and the file will parse everywhere.

Can this format JSON with comments?

No — comments are not valid JSON, so the parser stops at the first one and tells you where it is. Remove comments for strict JSON, or keep the file as JSON5 in tools that support it.

Related tools

JSON to CSV

Turn a JSON array into a spreadsheet-ready CSV.

CSV to JSON

Convert CSV rows into JSON objects.

YAML ↔ JSON Converter

Move configuration between YAML and JSON.

JWT Decoder

Decode the header and payload of a JSON Web Token.