JSON Formatter & Validator
Check that JSON is valid, see exactly where it breaks, and format or minify it.
Paste or type JSON.
Ctrl or ⌘ + Enter formats.
Paste JSON, or load an example.
Not valid JSON (checked before your last edit; press Validate to update)
How to Use the JSON Formatter & Validator
- Paste your JSON into the input box, or load the example.
- Press Format to lay it out with two-space indentation, Minify to remove every unneeded space, or Validate to only check it.
- If it is not valid, the message names the line and column, shows the surrounding lines and marks the spot. Go to error jumps there in the input box. Fix it and press the button again.
- Copy output copies the result. Your input is never changed by Format or Minify.
What Counts as Valid JSON
This tool checks strict JSON, the standard that APIs, configuration files and most programming languages read. It is stricter than a JavaScript object. It rejects, and points to:
- trailing commas, such as
[1, 2,] - single-quoted strings and unquoted property names
- comments
undefined,NaNandInfinity- text that runs on after the value, such as two objects in a row
The value at the top can be any JSON value, not only an
object or array: "text", 42,
true and null are valid on their
own.
It does not repair anything or guess what you meant. The answer is the same every time.
What Format and Minify Change
Only the spaces and line breaks between values. Numbers and
text are copied exactly as you wrote them, so
1.0 stays 1.0, a long number is
not rounded, escapes such as \u00e9 are not
rewritten, and keys keep their order.
Two things are valid JSON but worth knowing, so they are shown as notes rather than errors: an object that repeats a key (most parsers keep only the last value), and an integer with more than 15 digits, which JavaScript would round when it reads it. The tool checks the syntax of JSON, not its meaning, so it does not validate against a schema.
Size Limits
The tool works on up to 2.0 million characters, nested up to 500 levels. While you type, text up to 200,000 characters is checked automatically after a short pause; larger text is checked when you press a button. Very large documents are better handled by a command-line tool.
Common Uses
- Reading an API response or a webhook payload that arrives on one line.
- Checking a configuration file before you deploy it.
- Checking JSON that an AI assistant or a log gave you before you use it.
- Minifying JSON to send or store it compactly.
Payloads often hold Unix timestamps. To read one, use the Unix Timestamp Converter.
JSON Formatter & Validator FAQ
Is my JSON sent anywhere?
No. Checking, formatting and minifying all run in your browser, and the text is not uploaded or stored by ToolZen Hub. Reloading the page clears it.
Why is my JSON rejected when JavaScript accepts it?
A JavaScript object literal allows things JSON does not: single quotes, unquoted keys, trailing commas and comments. JSON is a stricter text format, and other programs that read it will reject those too.
Does it fix invalid JSON?
No. It tells you what is wrong and where, and leaves the change to you, so it never guesses at what you meant.
What does "more than 15 digits" mean?
JavaScript stores numbers as 64-bit floating point, so integers beyond 9,007,199,254,740,991 can be rounded when a program reads them. The tool keeps the number as you wrote it, and the note is a reminder that a JavaScript reader would not. IDs of that size are often safer as strings.
Does it check a JSON Schema?
No. It checks that the text is well-formed JSON, not that its fields and types match a schema.