JSON formatter, validator and minifier
Paste your JSON – the tool checks it instantly, points to the exact error with an explanation, and gives you the result pretty-printed or minified, ready to copy. Nothing is uploaded.
How it is calculated
What the tool checks
The rules come from RFC 8259, the internet standard for JSON (equivalent to ECMA-404). The tool reads your text character by character with its own parser and stops at the first violation. The message gives the line and column, marks the spot with a ^ and explains what is wrong – identical in every browser, because the built-in JSON.parse messages differ between browsers and are often unhelpful (“Unexpected token”).
The most common JSON errors
- Trailing comma after the last item:
{"a": 1,}– fine in JavaScript, invalid in JSON. - Single quotes or unquoted keys:
{'a': 1},{a: 1}– the correct form is{"a": 1}. - Comments (
//,/* */) do not exist in JSON. - JavaScript or Python values:
undefined,NaN,Infinity,True,None– onlytrue,falseandnullare allowed. - Numbers: no leading zero (
012), no+1, no.5or5., no hex (0x1F). - Strings: a line break or tab must be written as
\nor\t, a single backslash as\\(typical with Windows paths). - Invisible characters: a non-breaking space (U+00A0) copied from Word or a web page is not whitespace in JSON.
Beautify, minify, sort
The output is rebuilt from the validated content: Beautify indents each level with 2 or 4 spaces or a tab, Minify removes all optional whitespace (smallest file). Numbers and strings are kept exactly as written – unlike JSON.parse + JSON.stringify, 1.0 does not become 1 and 12345678901234567890 is not rounded. Sort orders keys by Unicode code units as in the JSON Canonicalization Scheme (RFC 8785): uppercase before lowercase, accented letters after both.
Warnings rather than errors
Duplicate keys in the same object are not forbidden by RFC 8259, but unreliable: most programs keep only the last value. A byte order mark at the start may be ignored by a parser – the tool does so and tells you.
Limits
The tool checks syntax, not meaning: whether required fields are missing or types are right is a job for a JSON Schema. Columns count Unicode characters starting at 1 (a tab = 1 character); editors with a tab width of 4 show a higher column. Input is limited to 5 million characters and 1,000 levels of nesting.
Frequently asked questions
Is my JSON uploaded or stored?
No. Validation and formatting run entirely in your browser. The text is not added to the address bar and not saved – only the options (output, indentation, sorting) are part of the link.
Why are comments and trailing commas not allowed?
JSON is deliberately minimal so that every programming language reads it the same way. Comments and trailing commas belong to extensions such as JSON5 or JSONC (used for VS Code settings, for example) – as plain JSON those files are invalid.
My JSON is valid, but the program still rejects it – why?
Usually the content does not match what the program expects: a missing required field, a number instead of a string, or a different structure. That is described by a JSON Schema or the API documentation. Also check the warning about duplicate keys.
Does the line and column match my editor?
Lines always do. Columns count characters starting at 1; a tab counts as one character, so does an emoji. Editors that display tabs as 4 columns will show a higher number. “Jump to error” puts the cursor right on the spot.
How do I find the problem after “unexpected end”?
Almost always a closing } or ] or a quotation mark is missing. The message names the line of the bracket that is never closed – look at the end of that block first.
Sources and legal basis
- STD 90, §§ 2–9: IETF RFC 8259 – The JavaScript Object Notation (JSON) Data Interchange Format
- ECMA-404 – The JSON Data Interchange Syntax, 2nd edition
- § 3.2.3: IETF RFC 8785 – JSON Canonicalization Scheme (Sortierung der Schlüssel)
- JSONTestSuite (Nicolas Seriot) – Testfälle für JSON-Parser
As of:
Related tools
- XML and CSV validator onlineCheck XML for well-formedness and validate CSV against RFC 4180: errors with line and column, auto-detected delimiter, table preview. Runs locally.
- Regex TesterTest JavaScript regular expressions live: matches highlighted, capture groups in a table, every part of the pattern explained. Free, nothing uploaded.
- Base64 Encode and DecodeEncode and decode Base64 and Base64url with proper UTF-8, plus URL encode/decode (percent-encoding). Clear error messages, runs locally in your browser.
- Hash Generator: SHA-256, SHA-512, SHA-1, MD5Calculate SHA-256, SHA-384, SHA-512, SHA-1 and MD5 hashes of text or files and verify checksums – locally in your browser, no upload, free.
- UUID generator: create and validate UUID v4 and v7Generate UUIDs online: version 4 (random) or version 7 (time-ordered), up to 1,000 at once. Validate a UUID and decode its version, variant and timestamp.
- Unix timestamp converterConvert a Unix timestamp to a date and back. Seconds, milliseconds, micro- and nanoseconds detected automatically; UTC, local time, ISO 8601 and more.