Developer Tools

Free JSON Validator

Find JSON syntax errors with exact line and column. Auto-fix common issues like trailing commas, single quotes and unquoted keys — all in your browser.

Instant Validation 100% Private Auto-Fix Line + Column

Input JSON

1
0 chars · 1 line
Tip: the validator updates as you type. When an error is found, the exact line is highlighted in the gutter and the input column is marked in red.

Diagnostics

Waiting for input
Paste JSON into the input on the left to validate it.

Ready to validate

Paste JSON on the left to see the analysis here
Note: this validator checks strict JSON, per RFC 8259. Extensions like JSON5 and JSONC (with comments) will report errors.

What Is JSON Validation?

JSON validation checks whether a piece of text conforms to the official JSON specification (RFC 8259). Valid JSON can be parsed by any JSON library in any programming language; invalid JSON causes parse errors in applications, breaks API calls, and corrupts configuration files.

This validator uses the browser's native JSON.parse to determine validity, and then translates the resulting error messages into human-friendly diagnostics with exact line, column and context.

The most common JSON errors

ErrorExampleAuto-fix?
Trailing comma{"a":1,}✅ Yes
Single quotes{'a':'b'}✅ Yes
Unquoted key{a: 1}✅ Yes
Comments{"a":1} // note✅ Yes
Missing comma{"a":1 "b":2}❌ Manual
Unclosed bracket{"a":1❌ Manual
Invalid number01, .5, 1., 0x10❌ Manual
NaN / Infinity{"a":NaN}❌ Manual
BOM character(invisible UTF-8 BOM)✅ Yes
Escaped control chars"line\nbreak" (literal)❌ Manual

Why is JSON so strict?

JSON was deliberately designed to have almost no flexibility. Where JavaScript allows single quotes, unquoted keys, trailing commas, comments, and even functions as values, JSON accepts none of these. The reasoning is:

The trade-off is that humans frequently write "almost-JSON" — JavaScript object literals, JSON5, JSONC, or YAML-style configs — and expect them to work. The parser correctly rejects these, which is why validators exist.

What the validator reports

For every invalid input, the validator provides:

What Auto-Fix does

Auto-Fix applies targeted, non-destructive repairs for errors that have exactly one unambiguous solution:

Auto-Fix does not try to repair missing brackets or missing commas. Those are ambiguous — the fix would often be wrong, and silently producing wrong data is worse than reporting an error.

Structure analysis

When the JSON is valid, the validator goes beyond a simple "OK" and produces a structural overview:

This is useful for quickly sanity-checking an API response — spotting a suspiciously deep nested structure, or confirming that an array has the expected number of objects.

Common use cases

Debug API Errors

Find the exact syntax error that's causing an API integration to fail.

Config File Checks

Verify package.json, tsconfig.json or any config before committing.

Convert JS to JSON

Auto-fix turns JavaScript object literals into valid JSON.

Data Import Prep

Validate JSON before importing into a database.

Learn JSON Rules

See exactly which characters are accepted and which aren't.

Security Review

Verify that a JSON payload doesn't contain hidden syntax issues.

Structure Audit

Inspect depth and node counts of a large API response.

CI/CD Pipelines

Validate JSON artifacts before deployment.

Privacy and security

This JSON validator runs entirely in your browser. Validation uses the native JSON.parse; highlighting, error analysis and auto-fix are all local JavaScript. Your JSON never leaves your device. Safe for API keys, credentials, proprietary data, customer records and any other sensitive payload.

Frequently Asked Questions

What does a JSON validator do?
A JSON validator checks whether a piece of text is valid JSON according to the official specification. It reports the exact location of any syntax error, describes the problem in plain English, and suggests how to fix it.
What is the difference between a JSON validator and a formatter?
A validator focuses on correctness — it tells you whether the JSON is valid and where errors are. A formatter focuses on presentation — it re-indents valid JSON to make it readable. This validator also includes format-preserving fixes for common errors.
Why is my JSON invalid?
The most common causes are: trailing commas after the last item, single quotes instead of double quotes, unquoted object keys, comments, NaN or Infinity values, and unclosed brackets or braces. The validator identifies each type of error with its exact location.
What does Auto-Fix do?
Auto-Fix repairs the most common JSON syntax errors in place: trailing commas, single quotes around strings and keys, unquoted object keys, and stray comments. It does not repair structural errors like missing brackets — those need manual correction.
Can the validator fix missing brackets?
No. When a bracket is missing, the validator cannot know which bracket was intended to close which structure — the data is fundamentally ambiguous. Auto-Fix only handles errors that have a single, unambiguous repair.
What is a JSON parse error?
A parse error is a message from a JSON parser saying that it encountered something it couldn't process. It's what your application sees when it tries to read invalid JSON. This validator surfaces those parse errors with a human-friendly location and suggestion.
Does the validator preserve my formatting?
Yes. The validator never reformats your input unless you explicitly click Auto-Fix. It only analyzes and reports — the original indentation, line breaks and whitespace stay exactly as you pasted them.
What is JSON5 or JSONC?
JSON5 and JSONC are extensions to JSON that allow comments, trailing commas and unquoted keys. Standard JSON does not. This validator checks strict JSON — if you paste JSON5 or JSONC with comments, it will report them as errors, but Auto-Fix can often convert them to valid JSON.
Is my JSON uploaded to a server?
No. All validation happens locally in your browser using the native JSON.parse API. Your data never leaves your device.
Is this JSON validator free?
Yes. It is 100% free, requires no sign-up, and runs entirely in your browser. No limits, no watermarks, no premium tier.

Related Developer Tools

Done!