JSON validator

Paste JSON. If it's broken, find out where.

The validator runs JSON.parse on whatever you paste and reports the verdict. If the document is invalid, it shows the line and column of the first character the parser couldn't accept — which is usually a few characters past the actual mistake. Nothing is uploaded.


Last updated June 2026 · Maintained by the JSONNeat author

What this validator actually checks

The verdict you see here is whatever your browser's built-in JSON.parse returns. That's the same engine your Node backend or your front-end fetch().then(r => r.json()) calls, so if JSONNeat accepts your document, every other JavaScript runtime will too. The standard the parser implements is RFC 8259 — six rules cover everything: strings and keys must be in double quotes, braces and brackets must match, commas separate values but never trail the last one, comments are not allowed, numbers must be finite decimals without leading zeros, and the only value types are string, number, boolean, null, object and array.

The eight errors that account for most invalid JSON

After running thousands of validations, the same small set of mistakes shows up over and over. Recognising them on sight is faster than reading the error message:

  1. Trailing commas. {"a": 1, "b": 2,} looks fine because most programming languages allow it, but JSON does not. Remove the comma before the closing brace or bracket.
  2. Single quotes. {'a': 1} is invalid because JSON only allows double quotes for both keys and string values. This is the most common error when pasting JavaScript object literals.
  3. Unquoted keys. {a: 1} is a JavaScript object literal, not JSON. Every key must be a double-quoted string.
  4. Comments. JSON does not support // or /* */ comments. If you need comments in configuration files, consider JSON5, JSONC, or YAML instead.
  5. Unescaped control characters. Raw tabs, newlines and carriage returns inside string values must be written as \t, \n and \r. Pasting multi-line text directly into a JSON string almost always produces this error.
  6. Curly "smart" quotes. “like this” or ‘like this’ from a word processor will silently break JSON. The validator sees them as foreign characters, not delimiters.
  7. Unescaped backslashes in Windows paths. {"path": "C:\Users\me"} needs double backslashes: C:\\Users\\me. A single backslash starts an escape sequence.
  8. Missing or mismatched brackets. Easy to introduce when editing a deeply nested document. The line and column reporter in JSONNeat points to the location where parsing failed, which is usually a few characters after the actual problem.

Worked example

Here is a real-world snippet that fails validation:

{
  name: 'Ada Lovelace',
  born: 1815,
  skills: ['math', 'computing',],
  // first computer programmer
  bio: "Wrote the first
  algorithm intended for a machine.",
}

This document contains six separate errors: unquoted keys, single-quoted strings, a trailing comma after'computing', a JavaScript comment, an unescaped newline inside the bio string, and a trailing comma after the final value. The fixed version:

{
  "name": "Ada Lovelace",
  "born": 1815,
  "skills": ["math", "computing"],
  "bio": "Wrote the first\nalgorithm intended for a machine."
}

Both the \n escape inside the string and the removed trailing commas are what move the document from invalid to valid. Drop either fix and the validator rejects it.

Beyond syntax: structural validation

JSONNeat's validator answers a single question: is this parseable? That is necessary but rarely sufficient. A document can be syntactically perfect and still wrong for your API — missing a required field, using the wrong type, exceeding a value range, or violating a uniqueness constraint.

For those checks you need JSON Schema, a separate standard that describes the structure and constraints of valid JSON documents. A schema lets you declare that email must be a string matching an email pattern, that age must be an integer between 0 and 150, or that anitems array must contain at least one element. Tools like Ajv (JavaScript), jsonschema (Python) and JSON.NET (C#) consume the same schemas across languages.

See our JSON Schema tutorial for a hands-on introduction.

When validation alone is not the right tool

  • Untrusted input from the web. Valid JSON can still be dangerous if it contains unexpectedly large nested structures (an "exponential JSON" denial-of-service) or extremely long strings. Cap input size and parse depth at your application boundary.
  • JSON Lines / NDJSON streams. Each line is its own JSON document, but the file as a whole is not valid JSON. Validate one line at a time or convert to an array first.
  • Tagged or self-referential JSON. Some systems extend JSON with $refpointers, type tags, or BSON-style typed values. Those documents are valid plain JSON but require application-level interpretation to be useful.
  • Very large files. Browser-based parsers load the entire document into memory. For files over a few hundred megabytes use a streaming parser like jq, stream-json or oboe.js, which process JSON as a token stream.

How JSONNeat reports errors

When validation fails, JSONNeat shows the parser's message along with a line and column number computed from the position offset returned by V8 or SpiderMonkey. The reported location is the first character the parser could not consume — which is often a character or two after the actual mistake. For example, a missing comma between two object properties is detected when the parser reaches the next key, not at the comma's intended position. Look slightly to the left of the reported column to find the cause.

Privacy and what happens to your data

JSON content you paste here is processed entirely by JavaScript running in your browser tab. Nothing is uploaded, logged, cached or transmitted to JSONNeat or any third party. That makes the validator safe for checking responses from internal APIs, production payloads, or documents containing secrets — the same guarantee you would get from running jq on your own machine, with no install required.

Frequently asked questions

What does the JSON validator check?
It checks that your JSON conforms to the RFC 8259 specification — proper double-quoted strings and keys, matched braces and brackets, correctly placed commas, and only the allowed primitive types: string, number, boolean, null, object and array.
Why is my JSON invalid?
The most common causes are trailing commas, single quotes instead of double quotes, unquoted object keys, JavaScript-style comments (which JSON does not permit), unescaped control characters inside strings, and copy-paste artifacts like curly “smart” quotes from word processors.
Does the validator show me where the error is?
Yes. When parsing fails, JSONNeat reports the exact line and column of the first syntax error so you can jump straight to the problem instead of scanning the whole document.
Is my JSON sent to a server?
No. JSONNeat runs entirely in your browser using the native JavaScript JSON.parse engine. Your data never leaves your device, which makes it safe for validating internal API responses or sensitive payloads.
Does this validator support JSON Schema?
This page checks syntactic validity only — whether the document is parseable JSON. For structural validation (required fields, types, value constraints) you need JSON Schema. We cover schema validation in our JSON Schema tutorial.
Can I validate JSON Lines (NDJSON) here?
Not directly. JSON Lines is one JSON value per line, not a single JSON document, so the parser will reject it. Validate each line individually, or wrap the lines in an array if you control the source format.
Why does my JSON validate here but fail in my app?
Usually because the consuming code expects a specific shape (a particular key, type, or range), not just valid syntax. Syntactic validity is necessary but not sufficient — pair this validator with a JSON Schema check or runtime type guard.
Are numbers like NaN and Infinity valid JSON?
No. The JSON specification only allows finite decimal numbers. NaN, Infinity and -Infinity are not legal JSON, even though JavaScript represents them. Serialize them as null or as strings if you must transport them.
What about very large numbers?
JSON allows arbitrarily large numbers in the text, but JavaScript can only represent integers exactly up to 2^53 - 1 (Number.MAX_SAFE_INTEGER). Numbers larger than that may lose precision when parsed. Use strings for IDs from systems that issue 64-bit integers (Twitter snowflake IDs, database BIGINT, etc.).
Does this work on very large files?
Yes — JSONNeat handles multi-megabyte JSON without uploading anything. Performance depends on your device, but most files under ~50MB validate instantly. For files in the gigabyte range, use a streaming parser like jq, stream-json or oboe.js.