1. Home
  2. Guides
  3. Developer

How to Format and Validate JSON (and Fix Common Errors)

4 min readUpdated October 6, 2026

JSON FormatterBeautify, validate, minify and repair JSON. Free, no sign-up.

JSON from an API response or a log line is often one long unreadable line, and a single stray comma makes the whole document invalid.

Format and validate in one step

  1. Open the JSON Formatter and paste your JSON (or open a .json file).
  2. Choose 2 spaces, 4 spaces or tabs, or minify it.
  3. If the JSON is invalid, the formatter shows the line and column of the first error. Fix it and the output updates.

Your data never leaves the browser, so you can paste production payloads, configuration files and tokens without sending them to a server.

The errors you will see most

Error Example Fix
Trailing comma {"a": 1,} Remove the last comma.
Single quotes {'a': 1} JSON needs double quotes: {"a": 1}.
Unquoted keys {a: 1} Quote the key: {"a": 1}.
Comments // note JSON has no comments; remove them.
Wrong value undefined, NaN Use null or a number.

The Repair button fixes trailing commas, comments and quote problems automatically, which is handy for JavaScript-style objects pasted from code.

Explore large documents

Switch to the collapsible tree view to fold big arrays and objects, and use sort keys to compare two documents more easily.