JSON Validator - DigiKitApp

Check whether a JSON text is valid.

When should you use this?

Use this when you need to quickly check whether a JSON file or API response is syntactically valid; it points to the exact location of an error.

When shouldn't you use this?

If you need to check that the JSON is syntactically valid but also matches a specific schema (which fields are required, say), you need a schema validator instead of this tool.

Step-by-step

  1. Copy the entire JSON you want to check. Grabbing only part of it can produce a misleading error about a missing bracket.
  2. Paste it into the "JSON text" field.
  3. Click "Run". The result tells you whether the text is valid and, if not, where the error is.
  4. Go to that spot and look at the characters just before it too. The real cause is often on the line above the one reported.

Example

You added a line by hand to a web app's settings file and now the app throws an error on startup. Paste the file into the validator and it points at the closing bracket after the last item in a list. Look closer and there's a stray comma after that last item. JavaScript accepts trailing commas, but JSON doesn't. Delete the comma, run it again, and the text comes back valid. The app reads its settings without complaint.

What does JSON validation check?

Validation checks whether the text follows JSON syntax: matching brackets, quotes, commas and value types. Most errors come from a few typical causes: a missing or extra comma, single quotes, unquoted keys, an unclosed bracket. Validation only checks the form; it does not show that the data is meaningful or fits an expected schema.

When looking for errors

  • Use the line and column in the error message; the problem is often just before that point.
  • Validating large JSON in sections makes the error easier to find.
  • Smart quotes (“ ”) that come along when copying are invalid; use plain quotes.
  • A separate schema validation is needed to check that expected fields exist.

Things to keep in mind

  • The usual suspects are trailing commas, single quotes, unquoted keys and an unclosed brace or bracket.
  • Text copied from Word or some note apps can turn straight quotes into curly ones. They're hard to spot by eye but make the JSON invalid.
  • JSON has no undefined, NaN or Infinity. These tend to sneak in when a program dumps its output directly.
  • A key that appears twice in the same object usually passes validation, but the program reading it will typically keep only one value. Watch for duplicates yourself.

Frequently asked questions

Is the code/data I enter stored anywhere?

No, nothing is sent to a server or stored; processing happens entirely in your browser.

Does it work with large inputs?

Yes, though performance may degrade with very large inputs (several MB or more).

Is this tool free?

Yes, it's completely free for core use and requires no account.