🔒 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

Explore More Developer Tools

Format, Validate, and Generate Data Instantly

TrueFormatter provides essential utilities for modern web development, including JSON formatting, YAML conversion, and more.

JSON Auto-Fixer & Formatter

Repair, validate, and beautify broken JSON (missing quotes, trailing commas).

JSON Validator & Linter

Check JSON syntax and see the exact line and column of every error.

JSON Beautifier

Pretty-print and indent JSON for easy reading and debugging.

JSON Compare & Diff Tool

Find the difference between two JSON objects visually and quickly.

JSONPath Tester

Evaluate JSONPath expressions with filters and recursive queries.

JSON Schema Generator

Generate a JSON Schema from any sample JSON document.

JSON to CSV Converter

Flatten nested JSON arrays into CSV for spreadsheets.

YAML ⇆ JSON Converter

Convert YAML to JSON or JSON to YAML instantly.

JWT Decoder

Decode and inspect JSON Web Tokens (JWT) Header and Payload.

JWT Generator

Create and sign HS256/HS384/HS512 JSON Web Tokens for testing.

Hash Generator (MD5, SHA)

Generate MD5, SHA-1, SHA-256, SHA-384 and SHA-512 hashes.

Base64 Encoder ⇆ Decoder

Encode text to Base64 and decode Base64 to text for API debugging.

URL Encoder & Decoder

Cleanly encode special characters in URLs and decode query strings.

SQL Formatter & Beautifier

Format SQL queries for MySQL, PostgreSQL, SQL Server, SQLite and more.

CSS Minifier & Compressor

Optimize CSS by removing whitespace and comments to accelerate page load time.

JS Minifier & Compressor

Compress JavaScript to improve website speed and performance.

Regex Tester & Debugger

Test JavaScript regular expressions with live match highlighting and groups.

Cron Expression Generator

Build cron schedules, read them in plain English and preview next runs.

UUID / GUID Generator

Generate unique V4 UUIDs for database keys or testing.

Epoch converter online

Convert UNIX timestamps to human-readable dates and back instantly.

Crop Image Online

Crop images exactly as selected with fixed aspect ratios. No upload, no resize, no quality loss.

Compress Image Online

Compress JPG, PNG & WebP images directly in your browser. No upload, no tracking, instant download.

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.