JSON Validator

Validate JSON with invisible character detection and detailed error explanations.

Free Runs in your browser
0 characters

Paste or type JSON above to validate it.

How to use

  1. 1 Paste or type your JSON into the text area.
  2. 2 The tool validates it instantly and shows any errors with the exact position.
  3. 3 Review the "Show invisible characters" panel for hidden Unicode characters that break parsing.
  4. 4 If valid, click "Copy valid JSON" to copy the formatted output.
  5. 5 Use the link to the JSON Formatter for pretty-printing and minification.

Key features

  • Detects invisible characters: zero-width spaces, BOM, non-breaking spaces, and control characters
  • Shows the actual character at the error position with its Unicode codepoint
  • Byte-level context around each error position for easier debugging
  • One-click link to JSON Formatter for pretty-printing valid JSON

What Is a JSON Validator?

A JSON Validator checks whether a given string conforms to the JSON specification and reports syntax errors with their exact location. Unlike a JSON Formatter, which focuses on pretty-printing, a validator is optimized for detecting what's wrong and explaining why — including cases where the error is caused by invisible characters rather than the JSON itself.

Standard validation tools show you that something is wrong, often with a cryptic message like "unexpected token at position 347". This tool also shows you what is at that position — whether it's a zero-width space, a UTF-8 BOM, or a control character that your editor or terminal silently inserted.

Common Use Cases

Debugging "unexpected token" errors

When a validator says "position 347" without explaining what is there, this tool shows the actual character and its Unicode codepoint.

Finding invisible characters

Zero-width spaces, UTF-8 BOM, and non-breaking spaces that sneak in from terminals and emails are detected and listed with their exact offset.

Debugging API 400 responses

When an API rejects a JSON payload that looks correct, paste it here to check for hidden characters or serialization issues.

Verifying generated JSON

Validate JSON output from AI models, code generators, or serialization libraries before using it in production.

Checking config files

Validate package.json, tsconfig.json, or any JSON config file for syntax errors before committing.

Cross-language serialization

When a value serialized in one language fails to parse in another, validate it here and inspect the exact byte that causes the failure.

JSON Validator vs JSON Formatter

FeatureValidatorFormatter
Syntax validationDetailed error with positionBasic error message
Invisible character detectionYesNo
Unicode codepoint at errorYesNo
Pretty-printingNo (links to Formatter)Yes
MinificationNoYes
Real-time validationYesYes