🔒 Runs in your browser — nothing is uploaded✓ Free, no signup

JSON Validator — Check JSON Syntax Online

Paste JSON to validate it as you type. Errors show the exact line and column, and the broken line is highlighted so you can fix it fast.

Loading...

0 characters

When should you use the JSON Validator?

  • An API or JSON.parse throws “Unexpected token” and you need to find where
  • Checking a config file (package.json, appsettings.json) before deploying
  • Confirming a webhook or API payload is well-formed before sending it

How to use the JSON Validator

  1. 1

    Paste your JSON

    Paste or type into the editor. Validation runs automatically a moment after you stop typing.

  2. 2

    Read the result

    A green box means the JSON is valid and shows the root type, key count and nesting depth. A red box shows the error message with its line and column.

  3. 3

    Fix the highlighted line

    The line with the first error is highlighted and scrolled into view. Fix it and the result updates.

  4. 4

    Format or copy

    Once valid, click Format to pretty-print it with 2-space indentation, then Copy.

Examples

Trailing comma

JSON does not allow a comma after the last item.

Invalid

{
  "id": 1,
  "tags": ["a", "b",]
}

Valid

{
  "id": 1,
  "tags": ["a", "b"]
}

Single quotes and unquoted keys

Keys and strings must use double quotes.

Invalid

{ name: 'Ada', 'age': 36 }

Valid

{ "name": "Ada", "age": 36 }

Common errors and how to fix them

Unexpected token } in JSON
Usually a trailing comma right before the closing brace or bracket. Remove the last comma.
Expected double-quoted property name
A key is unquoted or uses single quotes. Wrap every key in double quotes.
Unexpected token / in JSON
The input contains a // or /* */ comment. JSON does not support comments — delete them.
Unexpected end of JSON input
The document is cut off: a missing closing } or ], or an unterminated string. Check the end of the input.
Bad control character in string literal
A string contains a raw tab or newline. Escape it as \t or \n.
Unexpected token in JSON at position 0
The input does not start with JSON — often an HTML error page, a BOM character, or text copied with a prefix. Check what your API actually returned.
Related tools: JSON Formatter · JSON Schema Generator · JSON Compare

More from JSON Tools

Free tools that run in your browser — no signup, nothing uploaded.

JSON Validator FAQ

It checks that your text follows the JSON syntax rules in RFC 8259: double-quoted keys and strings, no trailing commas, no comments, and only the values string, number, object, array, true, false and null.

Paste it into the validator. If it is invalid you get the line and column of the first error and that line is highlighted in the editor. Fix it and the validator re-checks automatically.

The parser hit a character it did not expect at that position. The usual causes are single quotes instead of double quotes, an unquoted key, a trailing comma before } or ], or a comment.

No. Standard JSON does not allow comments. Formats like JSONC or JSON5 (used by tsconfig.json and VS Code settings) do, but JSON.parse and most APIs will reject them.

The validator only reports errors. To auto-repair common problems such as unquoted keys, single quotes, trailing commas and comments, use the Fix JSON button in the TrueFormatter JSON Formatter.

No. Validation uses your browser's built-in JSON.parse. Nothing you paste is sent to a server.