Quick answer
A JSON validator checks whether text is syntactically valid JSON and pinpoints the exact location of any error. JSON Dev Tools validates with the browser's native JSON.parse() — entirely client-side, so your data is never sent to a server. Paste JSON, click Validate, and fix the flagged error position.
Key takeaways
- Validation finds errors — trailing commas, single quotes, unquoted keys, unclosed brackets.
- The error position is highlighted so you can fix it fast.
- Standard JSON only — JSON5 and comments are not valid JSON.
- 100% private — runs in your browser; nothing you paste is uploaded.
How JSON Validation Works
- Your input is passed to the browser's native
JSON.parse()function — the same parser used by every JavaScript runtime and API client. - Any syntax error throws a
SyntaxErrorwith an error message and character position, which the tool surfaces directly so you know exactly where to look. - The Repair button attempts to auto-fix the most common issues — trailing commas, single-quoted strings, and JavaScript-style comments — before re-validating.
- All processing happens entirely in your browser; your JSON is never sent to a server.
When to Use the JSON Validator
- Before sending a request body to an API to avoid 400 Bad Request errors caused by malformed JSON.
- After manually editing a JSON config file (package.json, tsconfig.json, settings files) to confirm it is still parseable.
- When debugging an "Unexpected token" or "Unexpected end of JSON input" error thrown by your application's
JSON.parse()call. - When an API returns an error and you want to rule out the request payload as the cause before investigating the server side.
Common JSON Errors — Quick Reference
| Error | Cause | Fix |
|---|---|---|
| Unexpected token , | Trailing comma after last item | Remove the final comma |
| Unexpected token ' | Single-quoted string or key | Replace ' with " |
| Unexpected end of JSON input | Unclosed bracket or brace | Add the missing } or ] |
| Unexpected token u / N | undefined or NaN value |
Replace with null or a quoted string |
| Unexpected token / | JavaScript-style comment | Remove all // and /* */ comments |
| Expected property name or '}' | Unquoted object key | Wrap key in double quotes |
Frequently Asked Questions
How do I fix JSON validation errors?
Read the error message, then correct the issue in the input field. Common problems are missing commas, wrong quotes, and unclosed brackets.
Can this page validate large JSON files?
Yes, but very large files may slow down your browser. For best results, validate JSON in smaller chunks if needed.
Does this validator support JSON5?
This tool checks standard JSON syntax. It does not support JSON5 extensions like comments or unquoted keys.
What is the difference between a JSON validator and a JSON formatter?
A validator checks whether JSON is syntactically correct and reports any errors. A formatter takes valid JSON and adds indentation and line breaks to make it human-readable. Validation must come first — trying to format invalid JSON will fail. Use this tool to validate first, then head to the JSON Formatter to beautify it.
What causes "Unexpected token" errors in JSON?
Unexpected token errors mean the parser hit a character it did not expect at that position. Common causes include: a trailing comma after the last item in an array or object, single-quoted strings instead of double-quoted, an unquoted key, a JavaScript comment (// or /* */), or bare undefined and NaN values which are not valid JSON.