← Tools
Utilities

JSON Formatter & Validator

Format, minify, and validate JSON. Errors are highlighted with the exact position. Nothing leaves your browser.

Input JSON0 chars
Output0 chars

About JSON

JSON (JavaScript Object Notation) is a lightweight data-interchange format defined in RFC 8259. It is easy for humans to read and write and easy for machines to parse and generate. See also: json.org.

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 human readability — use in development and documentation.

Minify removes all whitespace — use in production to reduce payload size (saves ~20–30% typically).

Common JSON Mistakes

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

Frequently Asked Questions

Can JSON have comments?

No — standard JSON does not support comments. Use JSONC (JSON with Comments) or JSON5 for config files that need comments; tools like VS Code support these.

What is the difference between JSON and JavaScript objects?

JSON keys must be double-quoted strings. JS objects allow unquoted keys, single quotes, trailing commas, and comments. JSON.parse() is strict.

Does minify lose data?

No — minification only removes insignificant whitespace. The data and structure are identical. JSON.parse(minified) gives the same object as JSON.parse(formatted).

How do I handle large JSON?

For very large files, use streaming parsers (JSONStream in Node.js) or the JSON Editor tool on this site which provides a full-featured editor with syntax highlighting.