Advertisement

JSON Formatter & Validator

Paste your JSON to instantly format (pretty-print), minify, or validate it. See exact parse errors with line and column numbers.

JSON Cheat Sheet

Data Types

String "hello world"
Number 42 / 3.14
Boolean true / false
Null null
Array [1, 2, 3]
Object {"key": "val"}

Syntax Rules

  • Keys must be double-quoted strings
  • Strings must use double quotes (not single)
  • No trailing commas allowed
  • No comments allowed
  • Numbers cannot have leading zeros
  • Boolean/null must be lowercase
  • Root can be object, array, or primitive

Frequently Asked Questions

JSON (JavaScript Object Notation) is a text format derived from JavaScript object literal syntax, but with stricter rules: keys must be double-quoted strings, single-quoted strings are not allowed, trailing commas are forbidden, and comments are not permitted. JavaScript objects are more flexible and can contain functions, undefined values, and symbols.

Common causes include: trailing commas (e.g. [1, 2,]), single-quoted strings, unquoted keys, comments, undefined/NaN values (not valid JSON), or invisible Unicode characters. The validator shows the exact line and column of the error.

Minification removes all whitespace, newlines, and indentation from JSON, reducing file size. This is useful for API responses, configuration files, and any context where bandwidth or storage matters. The content is identical to formatted JSON but harder for humans to read.

The tool runs entirely in your browser with no server upload. Practical limits depend on your browser — very large JSON files (tens of MB) may cause the browser to slow down, but typical API responses and config files work fine.

Related Calculators