Skip to content
PocketDesk
Your files are processed on your device, never uploaded

JSON validator

  • On device
Input
Ln 1, Col 11 line0 BUTF-8

Paste, drop or open a file in Input to see the result here.

Waiting for input
  • ⌘Enter Run now
  • ⌘⇧C Copy result
  • ⌘F Find in result
  • Esc Exit full screen
  • Use Ctrl instead of ⌘ on Windows and Linux

How to validate JSON

  1. Paste your JSON into the JSON to check box, or drop a .json file on it.
  2. Read the result. A green message says Valid JSON and describes the top-level value, such as an object with 12 keys.
  3. If something is wrong, the message gives the line and column. Go to that spot, fix it and the check runs again by itself.
  4. Leave Warn about duplicate keys on to catch repeated keys inside one object.

What counts as invalid

JSON is stricter than JavaScript. These are the mistakes people hit most often:

  • A trailing comma after the last item: {"a": 1,}.
  • Single quotes around strings or keys: {'a': 1}.
  • Unquoted keys: {a: 1}.
  • Comments and a leading BOM or stray text before the first brace.
  • Numbers such as 01, .5 or 1. and values like NaN, undefined or Infinity.
  • A string with a raw line break inside it. Use \n instead.

The error points to the character where the parser first noticed the problem. The real mistake is sometimes just before it, such as a missing comma on the line above.

Validator or formatter?

This page tells you whether the JSON is correct and where it breaks. If you also want it laid out neatly, minified or sorted, use the JSON formatter, which reports the same errors and gives you the cleaned-up text.

Tips

  • If your data is YAML, convert it first with YAML to JSON; a parse error there points to the YAML line.
  • For a tabular file, CSV to JSON creates valid JSON for you.
  • Large inputs are checked in a background thread, so the page keeps responding.

Privacy

Config files and API payloads often contain keys and personal data. Everything here happens on your device. Nothing is uploaded, stored or logged.

Questions

What does the JSON validator check?

It checks the strict JSON syntax from RFC 8259 and reports the line and column of the first error. It can also list duplicate keys.

Why are duplicate keys a problem if the JSON is valid?

The syntax allows them, but parsers keep only the last value, so an earlier value is silently lost. That is usually a mistake.

Does it check my data against a schema?

No. It checks syntax only. A value can be valid JSON and still be wrong for your API.

Are comments allowed in JSON?

No. Standard JSON has no comments, so a // or /* */ comment is reported as an error. Remove it or use YAML.

Is my JSON sent anywhere?

No. Validation runs in your browser and nothing is uploaded.

More developer tools