Skip to content
Cuisdev

JSON Validator

Find the exact line and character of any JSON syntax error

  • Runs in your browser
  • No sign-up
  • Free forever
Loading the tool…

How to use the JSON Validator

  1. 1

    Paste the JSON you want to check into the editor, or drop a file onto the page.

  2. 2

    The validator runs as you type. A valid document shows no error markers.

  3. 3

    If there is a problem, the error is underlined and a message beneath the editor gives the line, the column and the cause. Click it to jump to the spot.

  4. 4

    For the common mistakes the editor offers an automatic repair. Accept it, or fix the text by hand, and the error disappears.

Features

  • Validates against strict JSON (RFC 8259), the format APIs and config parsers expect
  • Reports the exact line and column of the first error
  • Explains the most common mistakes in plain English, with the fix
  • Click-to-jump from the error message to the problem character
  • Syntax highlighting and bracket matching make unbalanced braces obvious
  • Runs entirely in your browser, so sensitive data is safe
  • Format or minify the document once it passes

What makes JSON invalid

JSON has a deliberately tiny grammar: objects, arrays, strings, numbers, true, false and null. Everything else is an error. The strictness is what makes JSON portable across every language, but it also means a document that looks fine to a human can still be rejected by a server.

The validator parses your text with the same rules a browser or API uses and shows you the first problem it meets. Fix it and run again; most documents have only one or two issues.

The five mistakes that cause most errors

  1. Trailing commas. {"a": 1,} is invalid. Remove the comma after the last item.
  2. Single quotes. {'a': 1} is invalid. Use double quotes for keys and string values.
  3. Unquoted keys. {a: 1} is invalid. Keys must be strings in double quotes.
  4. Comments. // note and /* note */ are not allowed. Strip them before sending.
  5. Special values. undefined, NaN and Infinity are not JSON. Use null or a number.

Validate before you ship

Invalid JSON in a config file can take down a deploy; in an API response it breaks every client at once. Pasting the document here before committing or publishing takes a few seconds and removes an entire category of production incidents. When the document passes, the JSON Formatter will make it readable and the JSON Minifier will make it small.

Frequently asked questions

What does "Unexpected token" mean?
The parser met a character it did not expect at that position. The validator translates the most common cases, such as a trailing comma, single quotes or an unquoted key, into a specific hint under the status bar.
My JSON works in JavaScript but fails here. Why?
JavaScript object literals are more permissive than JSON. They allow single quotes, unquoted keys, trailing commas and comments. Strict JSON allows none of those, and that is what this validator checks, because it is what servers and APIs enforce.
Does it validate against a JSON Schema?
Not yet. This tool checks syntax only. Schema validation, which checks that the data has the right fields and types, is on the roadmap.
Can it check very large files?
Yes. Files up to 25 MB can be dropped onto the page, and larger documents work if your device has the memory. Everything runs locally.
Is my data private?
Completely. The validator never sends your JSON anywhere. It is safe for API keys, tokens and personal data.

Last updated .