← All tools

JSON Formatter — See the Error Line

Format, minify, and validate JSON. Invalid JSON shows the error line. Nothing is uploaded.

0 chars
0 chars

About JSON

JSON (JavaScript Object Notation) is a lightweight data-interchange format defined in RFC 8259. Valid JSON must use double-quoted keys, has no comments, and no trailing commas. Read more: JSON Formatting and Validation Best Practices.

Format vs minify

Format adds indentation and newlines for reading. Minify removes whitespace for production payloads (typically 20–30% smaller). Neither changes the data.

Common mistakes

  • Trailing comma after the last item
  • Single-quoted strings instead of double
  • Comments (// …) — not allowed in JSON
  • Unquoted keys
  • undefined values — use null

Frequently asked questions

How do I format JSON online?

Paste JSON into the left panel and choose Format. Indentation is added in the browser. Nothing is uploaded.

Where does this JSON formatter show the error?

Invalid JSON shows the parser message, including the character position, so you can jump to the broken line.

Does this JSON formatter upload my data?

No. Format, validate, and minify run with JSON.parse in your browser.

Does minify lose data?

No. Minify only removes insignificant whitespace. JSON.parse(minified) returns the same object.

Can JSON have comments?

No. Standard JSON does not allow comments or trailing commas. Use JSONC or JSON5 for config files that need them.