JSON Validator

Validate JSON online and find syntax errors with the exact line and column. Format, minify, copy or download the result.

You can also drag a .json file into the box.

Validate, format and tidy up your JSON files for free. This JSON validator finds syntax errors, shows clear validation messages and turns messy JSON documents into readable structures. Paste the content or import a .json file: checking happens as you type, and when something is wrong the tool points to the exact line and column, shows the snippet with a caret under the offending character and explains the problem in plain English — a trailing comma, single quotes, an unquoted key, a mismatched bracket and so on.

It's built for developers, students and anyone who works with APIs and system integrations: the payload that comes back with a 400 error, the config file that won't load, the response copied out of a log. Besides telling you whether the JSON is valid, it shows the root type, the number of keys or items, the nesting depth and the size, and it warns you when the same key appears twice in one object — something JSON tolerates but that often hides bugs. Everything runs in your browser; nothing is sent to a server.

Just need to pretty-print JSON that's already valid, with 2 or 4 spaces or tabs? Use the JSON Formatter.

How to validate JSON

  1. Paste the JSON into the box, drag a file into it or click "Import .json file".
  2. See the result instantly: "Valid JSON" in green or "Invalid JSON" in red, with the line, column and an explanation of the error.
  3. Fix the highlighted spot and watch the validation update as you type until the JSON passes.
  4. Choose the formatted or minified version of the result, then copy it or download the .json file.

Most common JSON errors

  • A comma after the last item: [1, 2, 3,] or {"a": 1,} — fine in JavaScript, forbidden in JSON.
  • Single quotes instead of double quotes: {'name': 'Ana'} must be {"name": "Ana"}.
  • Unquoted property names: {name: "Ana"} — in JSON every key is a double-quoted string.
  • JavaScript or Python values that don't exist in JSON: undefined, NaN, True, False and None.
  • Comments (// or /* */) and a missing comma between two properties, which often happens when copying and pasting snippets.

Practical example

Click "Invalid example" to load a JSON document with four typical problems. The validator stops at the first one and reports: line 3, column 13 — "True" is not a valid JSON value, use lowercase true. Once that's fixed it points to the single quotes around 'rating' on line 4, then the trailing comma in ["dev", "images",] and finally the comma before the closing }. In a few seconds the document passes and the result appears formatted, ready to copy.

Frequently asked questions

How do I know if my JSON is valid?

Paste it into the tool. If the syntax is correct you'll see "Valid JSON" along with a summary of its structure. If there's an error, the tool shows the line, the column, the snippet with the position marked and an explanation of the problem.

Why is the error line and column different from what my browser says?

Each browser describes JSON errors differently, and some don't report a position at all. This validator uses its own parser that follows the JSON specification (RFC 8259) and always points to the first character that breaks the rules — the same answer in every browser.

What's the difference between validating, formatting and minifying?

Validating checks whether the text follows JSON's rules. Formatting rewrites valid JSON with line breaks and indentation so it's easier to read. Minifying does the opposite: it removes spaces and line breaks to make the file smaller, the way it's usually sent over APIs.

Do duplicate keys make JSON invalid?

No. The specification allows them but recommends unique names, and in practice most languages simply keep the last value. That's why the tool shows a warning rather than an error: the document is valid, but there's probably something worth reviewing.

Is my JSON sent to a server?

No. Validation, formatting and minifying all happen in your browser. You can check payloads containing customer data, tokens or internal settings without them ever leaving your computer.

Why do very large numbers change when formatted?

Validation accepts any number, but to format the JSON the browser turns it into JavaScript values, which are precise to roughly 15–17 digits. Long IDs such as 12345678901234567890 may have their last digits changed in the output. If those numbers are identifiers, it's best to send them as quoted strings.