All tools

Format tool

JSON Formatter & Validator

Format, minify and validate JSON with clear errors. Free, private and processed locally in your browser.

When and how to format JSON

Use the formatter when an API response, configuration file or log payload is difficult to scan. Formatting adds indentation without changing values, while minifying removes unnecessary whitespace. Validation catches syntax mistakes before the data reaches an application.

Compact input

{"user":{"id":42,"roles":["editor","reviewer"]},"active":true}

Formatted output

{
  "user": {
    "id": 42,
    "roles": [
      "editor",
      "reviewer"
    ]
  },
  "active": true
}

Common JSON errors

  • Single quotes or bare keys: JSON requires double quotes around property names and string values. JavaScript object-literal syntax is not valid JSON.
  • Trailing commas: Remove the comma after the final property or array item. Strict JSON parsers reject trailing commas.
  • Unescaped characters: Quotes, backslashes and control characters inside strings must use valid JSON escape sequences.

Frequently asked questions

Does formatting change the JSON data?
No. It changes whitespace only. Keys, values, arrays and their order remain unchanged.
Is pasted JSON uploaded?
No. Formatting, minifying and validation run locally in your browser.
Will the formatter repair invalid JSON?
No. It reports the parser error so you can correct the source without the tool guessing at your intended data.

Related developer tools