Paste your JSON to format, validate, and minify it instantly. Nothing leaves your browser.
| Error | Cause | Fix |
|---|---|---|
| Unexpected token } / ] | A trailing comma after the last item | JSON forbids trailing commas, unlike JavaScript. Remove it. |
| Unexpected token ' | Single-quoted strings or keys | JSON requires double quotes on both keys and string values. |
| Unexpected token in position 0 | The response was not JSON at all | Usually an HTML error page returned by a server. Check the status code. |
| Unexpected end of input | A brace or bracket is never closed | Format the document and read the indentation to find the unclosed level. |
| Unexpected token N | A bare NaN, Infinity or undefined | None are valid JSON. Use null or a string. |
| Bad control character | A literal newline or tab inside a string | Escape it as \n or \t. |
| Unexpected non-whitespace after JSON | Two documents concatenated, or NDJSON | Split into separate documents, or wrap the lines in an array. |
true/false, and null.undefined. Dates have no native type either — they travel as ISO 8601 strings by convention, not by specification. This strictness is deliberate: it is what makes JSON parse identically across every language.| Mode | Use it when |
|---|---|
| Format (2 spaces) | Reading an API response, committing config to git, or debugging. Two-space indentation is the prevailing default in JavaScript and web tooling. |
| Format (4 spaces) | Matching a codebase that already uses four — common in Python and .NET projects. |
| Minify | Sending a payload over the network or storing it. Whitespace can be a substantial share of a deeply nested document, and no parser cares. |
Number.MAX_SAFE_INTEGER (9,007,199,254,740,991) silently loses precision on parse.No. RFC 8259 has no comment syntax, and a // or /* */ will fail validation. Formats such as JSONC and JSON5 add comments, but they are separate formats — strip comments before parsing as JSON.
JavaScript object literals tolerate a trailing comma; JSON does not. It is the single most common JSON syntax error.
No. Only whitespace changes. Key order is preserved and every value stays exactly as it was.
There is no date type. The convention is an ISO 8601 string such as 2026-08-19T12:00:00Z, which sorts correctly as text and parses everywhere. Unix timestamps as numbers are the other common choice.
JavaScript parses JSON numbers as 64-bit floats, so integers above about 9 quadrillion lose precision. APIs avoid this by sending large IDs as strings.
NDJSON puts one complete JSON document on each line, with no wrapping array. It streams well for logs and exports, but pasting it here will fail validation — wrap the lines in an array first.
No. Everything runs locally in your browser using the built-in parser.