Beautify, validate and minify JSON instantly.
Paste JSON and this indents it readably, or collapses it to a single line, and reports the exact location of any syntax error. Everything runs in your browser, which matters because JSON payloads routinely contain API keys, tokens and personal data.
JSON parsers report a character position rather than a description of what you meant. The most common causes, roughly in order of frequency:
{"a": 1,} is invalid. JavaScript object literals allow it; JSON does not.{'a': 1} is invalid.{a: 1} is valid JavaScript and invalid JSON.// nor /* */ is permitted.When an error points at a position that looks fine, check the line above it — an unclosed string or bracket is usually reported where the parser finally gave up rather than where the mistake was made.
| Type | Example | Notes |
|---|---|---|
| Object | {"key": "value"} | Keys must be double-quoted strings |
| Array | [1, 2, 3] | Ordered, may mix types |
| String | "text" | Double quotes only, escapes with backslash |
| Number | 42, -3.14, 1e5 | No leading zeros, no hex, no NaN or Infinity |
| Boolean | true, false | Lowercase only |
| Null | null | Lowercase; not "nil" or "None" |
There is no date type. Dates are conventionally carried as ISO 8601 strings such as "2026-08-06T12:00:00Z", or as Unix timestamps — which is why our timestamp converter is a frequent companion to this one.
JSON numbers have no specified precision, but most parsers — including JavaScript's — read them as IEEE 754 doubles. That safely represents integers only up to 2^53 - 1, or 9,007,199,254,740,991.
Larger integers lose precision silently. A 64-bit database ID or a Twitter snowflake ID passed as a JSON number can come back subtly different from what was sent, with no error raised. The standard fix is to transmit large identifiers as strings. Several major APIs learned this the hard way and now send IDs in both forms.
Decimal fractions have a related problem: 0.1 + 0.2 does not equal 0.3 in binary floating point. Monetary values should be stored as integer minor units — cents rather than dollars — or as strings, never as JSON floats.
Indented JSON is for humans; minified JSON is for transmission. Removing whitespace typically cuts payload size by 10-20%, though gzip or brotli compression closes most of that gap, so the practical saving on a compressed connection is smaller than it looks.
Formatting matters most in version control. A minified JSON file produces a single-line diff that shows nothing useful when it changes, whereas indented JSON with consistent key ordering produces reviewable diffs. For configuration files kept in git, format them.
Because strict JSON is awkward for hand-written configuration, several relaxed variants exist. JSONC adds comments and is what VS Code uses for its settings files. JSON5 adds comments, trailing commas, unquoted keys and single quotes. Neither is valid JSON, and a strict parser will reject both — so they are appropriate for files humans edit and inappropriate for data crossing a network.
Parsing and formatting happen locally in JavaScript. Your JSON is never uploaded or logged, which you can verify in your developer tools Network tab. This is worth checking on any JSON formatter, given how often the pasted content is an API response containing credentials.
Most often a trailing comma, single quotes instead of double, unquoted keys, or a comment — all valid JavaScript and none valid JSON. An invisible byte order mark at the start of a file is another common cause.
No. The specification has no comment syntax. Use JSONC or JSON5 for hand-edited configuration files, but never send them where a strict parser expects JSON.
JavaScript parses JSON numbers as doubles, which only represent integers exactly up to 2^53 - 1. Larger IDs lose precision silently. Transmit them as strings instead.
There is no date type. Use an ISO 8601 string such as "2026-08-06T12:00:00Z", which sorts correctly and is unambiguous, or a Unix timestamp if the consumer expects one.
No. Parsing and formatting run entirely in your browser. Nothing is uploaded or stored, which matters given how often JSON payloads contain tokens and personal data.