JSON Validator Online

Find JSON syntax errors fast and see exactly where the payload breaks.

What this tool does

This tool validates JSON syntax and reports the exact line, character position, and parse error when JSON is invalid.

Input formats: JSON String
Output formats: Validation Stream
Runs locally in your browser.

Use this validator when the payload fails to parse and you need the exact syntax problem. It is designed for error-finding, not pretty-printing.

Paste any JSON string and the validator checks it against strict JSON rules. If the payload is broken, you should see the line, character, and error type that caused the failure.

This is especially useful for debugging API responses, config files, exports from legacy systems, and hand-edited payloads where commas, quotes, or brackets often go wrong.

The validator runs locally in your browser, so internal payloads and sensitive data do not leave your machine.

Once the JSON is valid, switch to the formatter for readability or the minifier for compact production output.

How to validate JSON syntax

  1. Paste the JSON payload into the input area.
  2. Run validation to check the payload against strict JSON syntax.
  3. Review the reported line, character position, and error message, then correct the payload.

JSON Transformation

Input:
{"id":1,"name":"test"}
Output:
{
  "id": 1,
  "name": "test"
}

RFC 8259: What Makes JSON Valid

JSON syntax rules are stricter than most developers realize. RFC 8259 defines the authoritative specification. Strings must use double quotes, not single quotes. Object keys must be strings, which means they must also be double-quoted. Trailing commas after the last element in an array or object are forbidden. Comments in any form, whether // line comments or /* block comments */, are not part of the specification.

The only valid value types are strings, numbers, booleans (true and false), null, objects, and arrays. The values undefined, NaN, Infinity, and -Infinity are not valid JSON even though JavaScript accepts them. Numbers cannot have leading zeros (except for 0 itself) and must use a decimal point rather than a comma for fractional parts.

Whitespace between tokens is insignificant and can be freely added or removed. However, whitespace inside strings is significant and must be preserved. Control characters inside strings must be escaped using the \uXXXX notation. These rules seem straightforward individually, but violations are common in hand-written JSON, especially when developers transfer habits from JavaScript object literal syntax.

Strict vs Lenient Parsing Across Languages

Different programming languages and libraries interpret JSON strictness differently, which creates portability issues. JavaScript's JSON.parse() is relatively strict but accepts some edge cases like duplicate keys, silently using the last value. Python's json.loads() is similarly strict and also allows duplicate keys.

Java's Jackson library defaults to strict parsing but offers feature flags to allow comments, trailing commas, single quotes, and unquoted field names. Go's encoding/json package is strict by default and will reject any deviation from the specification. Rust's serde_json follows the spec precisely.

This inconsistency means JSON that parses fine in one language may fail in another. A configuration file with JavaScript-style comments will work with Jackson's lenient mode but crash a Go service. A payload with trailing commas will survive a lenient Node.js parser but fail when consumed by a Python microservice.

Validating against the strict RFC 8259 specification, as this tool does, ensures your JSON is portable across all compliant parsers. If it passes strict validation, it will work everywhere.

Frequently Asked Questions

What JSON errors does this validator catch?

It catches missing commas, trailing commas, unclosed brackets and braces, unquoted keys, single-quoted strings, and other strict JSON syntax problems.

How is this different from the JSON Formatter?

The formatter is for readability. The validator is for strict syntax checking and precise diagnostics.

Can it validate JSON Schema?

No. This tool validates JSON syntax, not whether the payload matches a specific schema or data contract.

Does this tool run locally?

Yes, this tool runs entirely locally in your browser sandbox using JavaScript.

Is my data uploaded to a server?

No, your data is never uploaded to any server. All processing is strictly client-side.

Can I use this tool offline?

Yes, once the page is loaded, the tool can function completely offline without an internet connection.