JSON Validator
Validate JSON with detailed error messages showing line and column numbers
Enter JSON to validate
Shortcuts: Ctrl+Enter run · Ctrl+L clear · Ctrl+D download
About JSON Validator
A JSON validator checks whether a piece of text is valid JSON according to the official RFC 8259 specification. It pinpoints exactly where errors occur — showing the line number and column — so you can fix problems fast. Whether you are debugging an API response, checking a config file, or verifying data from a third-party source, this tool gives you an instant pass or fail with a clear error message.
- ✓Precise error messages with line and column numbers for every syntax problem
- ✓Validates against the full JSON specification including proper string escaping
- ✓Handles files of any size without slowing down
- ✓Detects common mistakes: trailing commas, single quotes, unquoted keys, and missing brackets
Understanding JSON Validation
JSON validation answers one specific question: "is this text well-formed JSON according to the spec?" That sounds simple, but the JSON specification (RFC 8259) is stricter than most people expect — and the gap between "looks fine to me" and "parses correctly" is exactly where this tool earns its keep.
What the JSON spec actually requires
- ·Object keys and string values must use double quotes — single quotes are not valid JSON, even though they work in JavaScript object literals
- ·No trailing commas after the last element in an array or the last property in an object
- ·Numbers cannot have leading zeros, leading plus signs, or trailing decimal points (`01`, `+5`, and `5.` are all invalid)
- ·The literals are exactly `true`, `false`, and `null` — not `True`, `False`, `None`, or `undefined`
- ·Strings must escape control characters; a literal newline inside a string value makes the whole document invalid
Tip: A surprising number of "broken JSON" reports turn out to be JavaScript object literals or Python dicts that were never valid JSON in the first place — they just happen to be readable by a permissive parser.
Reading a validation error
A good validator does more than say "invalid" — it tells you exactly where the problem is. This tool reports the line and column of the first syntax error, which is normally enough to spot the issue immediately:
Unexpected token } in JSON at position 47
→ Line 4, Column 3
{
"name": "Alice",
"age": 30,
} ← trailing comma before the closing braceNote that parsers report the position of the token that broke the parse, which is sometimes one character after the actual mistake (a missing comma is detected where the next value begins, not where the comma should have been). If the reported location looks "off by one token", check just before it too.
Validating JSON in your own code
Every mainstream language has a built-in or standard-library JSON parser that performs the same strict validation this tool does — wrapping the parse call in error handling is the simplest way to validate programmatically.
// JavaScript / Node.js
try {
JSON.parse(text)
console.log('valid')
} catch (err) {
console.log('invalid:', err.message)
}
// Python
import json
try:
json.loads(text)
print('valid')
except json.JSONDecodeError as e:
print(f'invalid: {e.msg} at line {e.lineno}, column {e.colno}')Where validation fits in a workflow
- ·Debugging a 400/500 error from an API — confirm whether the request or response body is even valid JSON before investigating further
- ·Reviewing a config file after a manual edit — catch a stray comma or missing quote before it breaks a deployment
- ·Checking data from an external source — third-party exports and webhooks occasionally produce near-JSON that needs a second look
- ·CI pipelines — many teams run a JSON validation step on config and fixture files as part of pre-commit hooks or build checks
Tip: If your JSON is invalid because it came from an LLM, a Python script, or a hand-edited file with comments and trailing commas, try the JSON Repair tool — it automatically fixes the most common syntax mistakes rather than just reporting them.