Free Online JSON Validator
Validate JSON syntax with detailed error messages, line numbers, and column markers. Format and minify JSON instantly.
data_object Input JSON
code Output Result
Click Validate to check JSON syntax, or Format / Minify to transform JSON.
Key Features
Instant Validation
Validate JSON syntax with detailed error messages, line numbers, and column markers.
Error Detection
Get exact error positions with context lines and a caret (^) marker for quick debugging.
Format & Minify
Beautify JSON with 2-space indentation or compress to a single line with one click.
Privacy Protected
All processing happens locally in your browser. No data ever leaves your device.
Frequently Asked Questions
Getting Started
What is a JSON validator?
The JSON Validator checks whether a given text string conforms to the JSON specification. It parses the input, catches syntax errors like trailing commas, unquoted keys, single quotes, and mismatched brackets, then reports the exact line and column where the parser failed so you can fix the problem immediately.
Is this JSON validator free?
Yes. All tools are completely free and run locally in your browser. No signup, no limits, no hidden costs.
Does the tool store my data?
No. Your JSON data never leaves your browser. All processing happens locally on your device, ensuring complete privacy and security.
Features & Usage
How do I validate JSON?
Simply paste your JSON into the input area and click the "Validate" button. The tool will check syntax automatically and show detailed error information. You can also switch to "Format" to beautify JSON or "Minify" to compress it for production use.
Why does JSON require double quotes?
JSON is a data interchange format, not executable code, and its spec (RFC 8259) mandates double quotes for strings and property names to keep parsing unambiguous across languages. JavaScript object literals are more lenient.
Can this validator handle JSON with comments?
No. Standard JSON does not support comments. Some tools (VS Code settings.json, TypeScript tsconfig.json) use "JSON with comments" (JSONC), which adds // and /* */ comment support as a non-standard extension.
How large a JSON file can I validate?
Most modern browsers handle JSON up to a few megabytes without issue. Around 10 MB you may notice a delay during parsing and syntax highlighting. For typical API payloads (a few kilobytes to a megabyte) the validation is instant.
Troubleshooting
What if my JSON has errors?
The validator will highlight the exact line and position of any syntax errors. Common errors include missing quotes around keys, trailing commas, or unescaped special characters.
Why is my JSON showing as invalid?
Common issues include: unquoted keys (JavaScript objects are not JSON), single quotes instead of double quotes, trailing commas in arrays/objects, and unescaped newlines or tabs in strings.
Can I use this tool offline?
Yes! Once you've visited the page, all functionality works offline thanks to local processing.
Advanced
What is the difference between JSON and JSONP (JSON with Padding)?
JSONP (JSON with Padding) is a historical technique for making cross-origin requests by wrapping JSON data in a JavaScript function call, e.g., callback({"name":"value"}). Unlike standard JSON, JSONP is executable JavaScript, not a data format. JSONP has been largely superseded by CORS headers, which allow standard JSON to be fetched cross-origin securely. Modern APIs should use CORS with standard JSON rather than JSONP.
How do I debug "Unexpected token" errors when parsing JSON?
Unexpected token errors typically occur at the first character where the parser encounters something unexpected. Common causes include: a BOM (Byte Order Mark) character at the start of a file, invisible Unicode characters like zero-width spaces, using single quotes instead of double quotes, trailing commas in arrays or objects, and unescaped control characters in strings. Copy the error position from this validator and inspect the surrounding characters in a hex editor or character inspector for hidden characters.
Does JSON allow duplicate keys in objects, and how do parsers handle them?
According to RFC 8259, JSON parsers should either reject duplicate keys or use only the last value encountered. JavaScript's JSON.parse uses the last value, making duplicate key detection difficult without custom validation. Duplicate keys often indicate a data serialization bug or a merging issue. Many JSON validators, including this one, will warn about duplicate keys when validating.
What are the size and depth limits for JSON data in practice?
JSON itself has no official size or depth limits, but practical constraints exist. Most JSON parsers allow a nesting depth of 512-1024 levels before throwing an error. Browsers typically handle JSON payloads of 10-100 MB without issues, but performance degrades with larger sizes. For API design, JSON payloads larger than 1 MB may cause network timeouts. The Node.js JSON parser by default throws an error at depths greater than 512.
Last updated: July 14, 2026
For the official specification, see RFC 8259 (JSON) and MDN: JSON.