JSON formatter

Pretty-print or minify JSON in your browser. Validates syntax and reports the exact error location.

Runs in your browser Instant No signup, no tracking

About this tool

Paste any JSON document to get a pretty-printed, 2-space-indented version. Invalid JSON produces a clear error message pointing at the offending line. Great for reading a compact API response, checking that a payload is well-formed before shipping it, or normalizing whitespace before diffing. Everything runs client-side — safe to paste tokens, IDs, and internal payloads.

Example

Paste the input on the left and you will get output like this:

Sample JSON

{"user":{"id":42,"name":"Ada Lovelace","roles":["admin","author"],"active":true}}

Resulting Formatted JSON

{
  "user": {
    "id": 42,
    "name": "Ada Lovelace",
    "roles": [
      "admin",
      "author"
    ],
    "active": true
  }
}

How to use JSON formatter

  1. Paste or type your JSON into the left pane.
  2. The Formatted JSON appears instantly in the right pane. Conversion runs in your browser — nothing is uploaded.
  3. Copy the result to your clipboard or download it as a file.

FAQ

Does this validate JSON?
Yes. Any parse error is reported with a message from the browser's native JSON parser.
Can I minify instead of pretty-print?
Use the JSON minifier tool for a single-line, whitespace-free output.
Are comments allowed?
No — standard JSON has no comments. Strip them first if you're pasting JSONC or JSON5.