Validate JSON instantly
with precise error locations
Strict RFC 8259 validation with exact line and column numbers. Paste your JSON and see errors highlighted in real time — no signup, no server, 100% client-side.
Validate JSON NowRFC 8259 Strict
Validates against the official JSON standard — not just JavaScript's loose JSON.parse rules.
Exact Error Location
Every error reports the precise line and column number, so you find problems instantly.
Instant Feedback
Validation runs as you type. No button to click, no round-trip to a server.
Everything you need to validate JSON correctly
JSON.parse() would silently accept.
Your data never leaves your device
Secure by architecture, not by policy
- No backend server — there is nowhere for your data to go
- No WebSocket, no fetch, no XHR for your JSON content
- The validator runs entirely in your browser using a custom-built parser
- Share links encode data in the URL fragment — never sent to a server
- No account, no login, no cookies tied to you
Related JSON tools
Common questions answered
Is JSON validation free?
Yes, completely free with no account needed.
What JSON standard does the validator follow?
It validates against RFC 8259, the current JSON standard, with precise line and column error locations.
Can I validate JSON without sending it to a server?
Yes. Validation is 100% client-side — your data never leaves your browser.
What errors does the validator detect?
It detects syntax errors like missing commas, unclosed brackets, invalid escape sequences, and trailing commas.
Can I validate JSON Schema too?
Yes. jsonfmt.dev has a dedicated Schema Validator tab that validates JSON data against a JSON Schema definition.
What is JSON validation?
JSON validation checks whether a string conforms to the JSON specification defined in RFC 8259. Valid JSON must use double-quoted strings, prohibit trailing commas, use null instead of undefined, and follow strict rules for number formats. Many common mistakes — like using single quotes or including JavaScript comments — produce invalid JSON that parsers will reject.
This validator goes beyond a simple pass/fail check. When it detects an error, it reports the exact line number, column position, and a human-readable description of what went wrong. It also suggests common fixes: "Did you mean to use double quotes?" or "Trailing comma found — try the Repair tab." This precision saves significant debugging time compared to generic parse error messages.
{
"name": "Alice",
"age": 30,
"active": true,
}
✗ Error at line 5, column 1: Trailing comma after last property in object. Tip: Remove the comma after "true" or use the Repair tab.
Get the most out of this tool
- Validate JSON before sending it to an API — a single trailing comma can cause a 400 Bad Request error.
- The validator reports exact line and column numbers for errors, making it faster than browser console debugging.
- Use validation alongside the Repair tab: validate first, then auto-fix common issues with one click.
Ready to validate your JSON?
Free forever. No signup. Instant results. Works offline.
Open JSON ValidatorHow JSON validation works
JSON validation is the process of checking that a string conforms to the grammar defined in RFC 8259, the current JSON specification. The spec defines a strict set of rules: strings must use double quotes, numbers cannot have leading zeros (except 0 itself), objects must have unique keys per the recommendation, and the six value types (string, number, object, array, true/false, null) are the only valid values. Any deviation from these rules produces an invalid JSON document.
This validator uses a character-by-character lexer to tokenize the input before parsing. This approach is superior to using JavaScript's JSON.parse() because when parsing fails, the lexer knows exactly which character caused the problem — its line number, column number, and the token it was trying to produce. Native JSON.parse() typically reports only vague messages like "Unexpected token" with no position information in older runtimes.
The validator distinguishes between structural errors and value errors. A structural error means the JSON is not well-formed — missing closing brackets, wrong value types in positions where only certain types are valid, or an unexpected end of input. A value error means the structure is correct but a value is illegal — for example, a number with a leading zero like 07, or a string containing an unescaped control character.
Practical JSON validation must also handle encoding issues. JSON is defined to be UTF-8, UTF-16, or UTF-32 encoded, with UTF-8 being the universal default on the web. The validator checks that string values do not contain raw bytes that would be illegal in UTF-8. Null bytes (0x00) inside JSON strings are technically allowed by the grammar but rejected by many parsers — this validator follows the liberal approach and reports them as warnings.
Beyond syntax validation, developers often need semantic validation — verifying that the data values meet business rules. Is the "email" field actually an email address? Is the "price" field a positive number? Is the "status" field one of a known set of strings? Semantic validation requires a JSON Schema. This tool's JSON Schema validator handles that use case — the plain validator only checks RFC 8259 compliance.
Validation is an essential step in data pipeline construction. ETL (Extract, Transform, Load) jobs should validate JSON at the extract step to reject malformed records before they corrupt downstream systems. API gateways validate request bodies before forwarding to backend services. Message queue consumers validate messages before processing. In each case, early validation prevents cascading failures.
When developers use this tool
Avoid these common JSON validation errors
- Trailing commas after the last element: The most frequent JSON mistake. Standard JSON does not allow {"a": 1,} or [1, 2, 3,]. This comes from JavaScript habits where trailing commas are valid syntax. Use the JSON Repair tool to fix these automatically.
- Using single quotes for strings: JSON requires all strings — both keys and values — to use double quotes. Writing {'name': 'Alice'} is JavaScript object syntax, not JSON. Replace all single quotes with double quotes.
- Comments inside JSON: JSON does not support // or /* */ comments. If your JSON file has comments, it is actually JSON5, JSONC, or a custom format. Use the JSONC formatter for comment-aware parsing.
- Undefined, NaN, and Infinity values: These are JavaScript values that have no JSON equivalent. Replace undefined with null, and replace NaN and Infinity with null or a sentinel number value like -1 before serializing.
- Unescaped special characters in strings: Double quotes inside strings must be escaped as \", backslashes as \\, and control characters as their \uXXXX escape sequence. Pasting text with smart quotes or em dashes copied from a word processor frequently triggers this error.
Additional frequently asked questions
What is the difference between JSON validation and JSON Schema validation?
JSON validation checks that the text is syntactically valid JSON per RFC 8259 — correct brackets, quoted keys, valid values. JSON Schema validation checks that valid JSON data meets additional constraints like required fields, value types, minimum/maximum, and string patterns. Both are necessary for robust data handling.
Does the validator check for duplicate keys?
RFC 8259 says duplicate keys "should" be avoided but does not prohibit them, so they are technically valid JSON. Most parsers silently use the last value for duplicate keys. This validator reports duplicates as a warning rather than an error, letting you decide how to handle them.
Can the validator handle very large JSON files?
Yes. Files larger than 100KB are processed in a Web Worker to prevent blocking the browser UI. The validator streams through the input lexically rather than building a full DOM, making it memory-efficient for large datasets like API export files.
Is valid JSON the same as safe JSON?
No. Valid JSON conforms to the grammar spec, but it can still contain malicious content depending on context. If you embed valid JSON directly into an HTML page without escaping, it can enable XSS attacks. The </script> sequence and <!-- are not safe to embed in JSON within HTML script tags without escaping.