Advertisement

Free Online JSON Formatter & Validator

Paste messy JSON to format, validate, minify, and inspect it instantly.

Waiting for input
Advertisement

About the JSON Formatter & Validator

JSON (JavaScript Object Notation) is the most common format for exchanging data between applications. It is strict: one missing comma, an extra trailing comma, or an unquoted key makes the whole document invalid. This tool checks your JSON, points out where a syntax error occurs, and formats it for readability.

Common JSON errors

  • Trailing commas: {"a": 1,} is invalid.
  • Unquoted keys: keys must be strings, so {name: "value"} is invalid.
  • Single quotes: JSON requires double quotes for strings.
  • Comments: JSON does not support // or /* */ comments.
  • Missing commas: every key-value pair and array item must be separated by a comma.

How to use this tool

  1. Paste your JSON into the input box. The status badge validates it as you type.
  2. Choose 2-space, 4-space, or tab indentation.
  3. Click Format to beautify, or Minify to remove whitespace.
  4. Copy or download the result.

Frequently asked questions

What does minify mean?

Minifying removes all optional whitespace, making the JSON as small as possible. It is useful for production data but harder for humans to read.

Does formatting change my data?

No. Formatting only changes whitespace. Sorting keys changes the order of object keys, but not their values or the meaning of the data.

Why does valid JSON get rejected?

Some formats look like JSON but are not, such as JSON5 or JavaScript object literals with comments and single quotes. Convert them to strict JSON first.

Sponsored
Find a bug? Report now