Skip to content
Utilgrove

JSON Formatter & Validator

Pretty-print, validate and minify JSON in your browser. Pinpoints syntax errors by line and column. Nothing is uploaded.

How to use the JSON formatter

Paste JSON into the left box. If it’s valid, the formatted version appears on the right, indented with two spaces (or choose four spaces or tabs). Tick Minify to strip whitespace instead. Copy the result or download it as a .json file. If the input has a syntax error, the right panel tells you what’s wrong and exactly where — line and column — so you can fix it.

JSON in 60 seconds

JSON (JavaScript Object Notation) is the standard format for exchanging data between web services. It has six value types:

  • Object{ "key": value, … } with string keys
  • Array[ value, value, … ]
  • String"text" in double quotes
  • Number42, -3.5, 1e10
  • Booleantrue or false
  • null
{
  "name": "Ada Lovelace",
  "born": 1815,
  "languages": ["English", "French"],
  "active": false,
  "spouse": null
}

The rules that trip people up

  1. Double quotes only. 'name' is invalid.
  2. Keys must be quoted. {name: "Ada"} is JavaScript, not JSON.
  3. No trailing commas. [1, 2, 3,] fails.
  4. No comments. // note and /* note */ are not allowed.
  5. No undefined, NaN or Infinity. Use null or a string.
  6. Numbers can’t have leading zeros (007) or a trailing decimal point (5.).
  7. Special characters in strings must be escaped: \", \\, \n, \t, \uXXXX.

The validator on this page checks all of these and reports the first one it finds.

Why format JSON at all?

APIs and databases usually return JSON minified on a single line to save bandwidth. That’s fine for machines but unreadable for humans debugging a response, reviewing a config file, or comparing two payloads. Formatting restores structure so nesting and arrays are obvious at a glance. Going the other way, minifying a hand-edited config before deployment trims file size by 20–40%.

Common workflows

  • Debugging an API — paste the raw response, format it, and find the field you need.
  • Fixing a config file — when an app refuses to start with “unexpected token”, paste the file here to locate the typo.
  • Preparing test data — write JSON by hand, validate it, then minify for the fixture file.
  • Reviewing logs — many services emit one JSON object per log line; format a line to inspect it.

Everything stays on your machine, so this is safe for production data and credentials — though you should still avoid pasting secrets anywhere you don’t have to.

Frequently asked questions

Is my JSON sent to a server?

No. Parsing and formatting happen in your browser with JavaScript. It's safe to paste API responses, config files and data containing private information.

Why does the validator say my JSON is invalid when it looks fine?

The usual culprits are a trailing comma after the last item, single quotes instead of double quotes, unquoted keys, or comments. All are allowed in JavaScript but not in JSON. The error message shows the line and column of the problem.

What's the difference between formatting and minifying?

Formatting adds line breaks and indentation so people can read it. Minifying removes all unnecessary whitespace to make the smallest possible file for transmission. Both produce identical data.

Is there a size limit?

No hard limit. Files of several megabytes format in a fraction of a second; very large files (50 MB+) may be slow depending on your device.

Last updated August 26, 2026.