How to Format JSON Online

Step-by-step guide to formatting, validating, and minifying JSON. Fix syntax errors and pretty-print JSON for readability.

JSON (JavaScript Object Notation) is the standard data format for APIs, config files, and data exchange. Raw JSON from APIs is often minified — all on one line, hard to read. Formatting adds indentation so you can inspect structure, find errors, and debug faster.

When to format JSON

  • Debugging API responses from REST or GraphQL endpoints
  • Reviewing configuration files before deployment
  • Validating JSON syntax before sending to a production API
  • Comparing two JSON payloads side by side

How to format JSON in 3 steps

  • Copy your raw JSON — from an API response, log file, or config
  • Paste it into the JSON Formatter input box
  • Click Format (or press Ctrl+Enter) to pretty-print with 2-space indentation
Open JSON Formatter

Format vs minify vs validate

Format (pretty-print) adds readable indentation. Minify removes all whitespace for smaller payloads — useful before sending JSON to an API. Validate checks syntax without changing the output — ideal for CI checks or quick error detection.

Common JSON errors

  • Trailing commas after the last item in an array or object
  • Single quotes instead of double quotes for strings
  • Unescaped special characters inside string values
  • Missing closing brackets or braces

Our JSON Formatter shows the exact parse error message and line context, making it easy to locate and fix syntax issues quickly.

Decode JWT tokens