JSON tools

JSON Validator and Linter

Find every syntax error in your JSON at once, each with its line, column and a fix, plus warnings for problems that still parse.

  • Free foreverNo trial, no paywall, no usage limits.
  • No sign-upOpen the page and start. We never ask for an email to use a tool.
  • PrivateEverything runs in your browser. Your input is never uploaded or stored on our servers.
  • Works offlineOnce the page has loaded, the tool keeps working without a connection.
RFC 8259 JSON, exactly what JSON.parse and APIs accept. Comments and trailing commas are errors.JSONC, as in tsconfig.json and VS Code settings: allows // and /* */ comments and trailing commas.
Load JSON with seven classic mistakes to see how each one is reported.

JSON to validate

Paste JSON, drop a file on the editor or open one (up to 5 MB). It's checked as you type, entirely in your browser.
Clear

Result

Every error is listed with its line and column. Click one to jump to it in the editor.

Paste JSON to check it

You'll see every syntax error with its exact line and column, plus warnings for duplicate keys and numbers JavaScript can't store exactly.

Need this built into your own API or pipeline? Talk to our team

Quick answer

A JSON validator checks that text follows the JSON grammar in RFC 8259, the rules every standard parser enforces. Paste JSON into Playxoft's free JSON Validator to check it as you type: every error is listed with its line, column and a suggested fix, and clicking one jumps to the spot. Valid JSON is also checked for duplicate keys and integers too large for JavaScript.

  • Every error listed
  • Line and column
  • Click to jump
  • Plain-English fixes
  • Duplicate key warnings
  • Unsafe number warnings
  • Strict or lenient mode
  • One-click repair

How to use the JSON Validator

  1. 1Paste JSON into JSON to validate, drop a file onto the editor, or click Open.
  2. 2Keep Strict for API payloads, or choose Lenient for JSONC config files such as tsconfig.json.
  3. 3Read the result: a green Valid JSON card with statistics, or a list of every error.
  4. 4Click an error to jump to its line and column in the editor, then fix it.
  5. 5Press Repair to fix common mistakes automatically, or Copy error report to share the list.

What makes JSON valid?

Valid JSON follows a short grammar defined in RFC 8259. A document holds exactly one value, and every value is one of seven things: an object, an array, a string, a number, true, false or null. The rules that trip people up:

  • Strings and object keys use double quotes. Single quotes and bare keys are JavaScript, not JSON.
  • Commas go between items, never after the last one.
  • There are no comments of any kind.
  • Numbers are plain decimals: no leading zeros (07), no leading +, no bare .5, no hex, and no NaN or Infinity.
  • true, false and null are lowercase.
  • Tabs and line breaks inside strings must be escaped, and the only escapes allowed are \" \\ \/ \b \f \n \r \t and \uXXXX.
  • Whitespace between tokens is limited to spaces, tabs, line feeds and carriage returns.

A lone string or number is valid JSON too. The original RFC 4627 required an object or array at the top level; RFC 7159 dropped that rule in 2014 and RFC 8259 kept it that way.

Strict or lenient: which validation mode should I use?

Use Strict for anything a program will read: API requests and responses, message queues, data files and package.json. It is at least as strict as JSON.parse, Python's json module and Go's encoding/json, so if a document passes here it parses there.

Use Lenient for JSONC, the configuration dialect that adds // and /* */ comments and, in most tools, trailing commas. Lenient mode accepts those two extensions and nothing else, so single quotes and unquoted keys are still reported.

You are checkingMode
An API payload or webhook bodyStrict
package.json or composer.jsonStrict
tsconfig.json, VS Code settings, devcontainer.jsonLenient
A JavaScript object literal or JSON5 fileRepair, then Strict

Repair converts near-JSON into strict JSON and tells you what it changed, so you can review the result before you rely on it.

Why can valid JSON still cause bugs?

Syntax is only the first check. The issues below slip past many parsers and editors, yet regularly cause production bugs, so the validator flags them as warnings:

  • Duplicate keys. RFC 8259 says names should be unique but doesn't forbid duplicates, and parsers disagree on what to do. JSON.parse keeps the last value, other parsers keep the first or reject the document. Whichever one your code sees, the other is silently lost.
  • Integers beyond 2^53. JavaScript reads 9007199254740993 as 9007199254740992. If an ID can grow that large, send it as a string.
  • Numbers too large for a double, such as 1e400, which JSON.parse turns into Infinity.
  • A byte-order mark at the start of the file. RFC 8259 forbids adding one and lets parsers ignore it, but JSON.parse throws on it, so a file that opens fine in an editor fails in JavaScript.

I-JSON (RFC 7493), a stricter profile of JSON for internet protocols, turns the first two warnings into rules: object names must be unique, and numbers should fit an IEEE 754 double.

How do I validate JSON in code?

Every language reports syntax errors; most give you a position you can turn into a line and column:

// JavaScript: a SyntaxError whose message includes a position
try { JSON.parse(text); } catch (err) { console.error(err.message); }

# Python: JSONDecodeError has .lineno and .colno
try:
    json.loads(text)
except json.JSONDecodeError as err:
    print(err.lineno, err.colno, err.msg)

# jq: exit status 0 means valid
jq empty data.json

// Go: a quick yes or no, or *json.SyntaxError with an Offset
ok := json.Valid(data)

All of these stop at the first error. This page keeps going and lists every error in one pass, which saves the fix, rerun, fix loop on a large file. Paste the error report into a ticket with Copy error report. Once the JSON is valid, the JSON Formatter pretty-prints, minifies or sorts it.

Is syntax validation the same as schema validation?

No. Syntax validation answers "is this JSON?". Schema validation answers "is this the JSON I expect?": the right keys, types, formats and ranges. {"age": "forty"} is perfectly valid JSON that your code may not survive.

For schema validation, describe the expected shape with JSON Schema, which validators such as Ajv check in JavaScript, or with Zod in TypeScript. The JSON to Zod generator writes a Zod schema from a sample document, so you can validate API responses at runtime with one line of code.

Frequently asked questions

A validator answers whether text is valid JSON. A linter also points out things that are valid but risky. This tool does both: it lists every syntax error, then warns about duplicate keys, unsafe integers and byte-order marks in otherwise valid JSON.
It is the error JSON.parse throws on invalid JSON. The position is a character offset from the start of the text, which is hard to find by hand. Paste the same JSON here to see the error as a line and column with an explanation and a fix.
Not strictly. RFC 8259 says object names should be unique, but a document with duplicates still parses. The behavior is unpredictable, though: JavaScript keeps the last value while other parsers keep the first or fail, so the validator warns about every duplicate.
Yes. Since RFC 7159 in 2014, any JSON value can be a complete document, including a string, number, true, false or null. Very old parsers that follow RFC 4627 may still expect an object or array.
No. It checks syntax and common pitfalls. To check that the data has the fields and types you expect, use JSON Schema or generate a Zod schema from a sample with the JSON to Zod tool.
No. Validation runs entirely in your browser. Nothing you paste or open is uploaded, logged or stored.

Last updated by the Playxoft engineering team.

From the engineers who built this tool

Fighting messy data every day?

When payloads, schemas and integrations keep breaking, the fix is usually upstream. We design typed APIs and backends that stay clean as you grow. Tell us what you are building and we will suggest the simplest architecture that fits.