Logo

MonoCalc

/

JSON Validator

Programming
Paste JSON, drop a file, or try a sample.

No document yet. Paste JSON, drop a file, or pick a sample.

Good to know

To check an API response, paste it here. In browser devtools: Network → right-click the request → Copy response.

Positions are line:column. Columns count UTF-16 code units, like most editor APIs, so an emoji counts as 2.

Up to 1 MB is validated as you type. Between 1 MB and 10 MB, validate on paste, on load or with Ctrl/Cmd+Enter. Larger documents are refused.

JSON5 syntax is detected and repaired to JSON, but there's no "valid JSON5" verdict.

Nothing is loaded from a URL, including a remote $ref: the browser blocks cross-origin reads, and there's no proxy.

Draft-04 and draft-03 schemas aren't supported.

There are no share links. JSON is often sensitive and large, so nothing leaves the page.

Reformatting isn't the main job here: use JSON Prettifier or JSON Minifier for that.

About This Tool

JSON Validator – Exact Errors, Plain-English Fixes and Schema Checks

A good JSON validator does more than say "invalid". This one checks your text against RFC 8259, the JSON standard, with its own parser, so every browser gives the same messages and the same line:column positions. It also reports every problem in one pass, where JSON.parse stops at the first one. Paste a document, drop a file or load a sample, and the editor marks each issue as you type. Each issue comes with a compiler-style snippet, a short explanation and, where the fix is unambiguous, a Fix button.

The "almost JSON" mistakes it recognises

Most broken JSON is nearly right. It was copied from JavaScript, printed by Python or pasted out of a chat app. The validator recognises these patterns and explains them instead of reporting a vague syntax error:

  • Trailing commas such as [1, 2,], and comments written with //, /* */ or #.
  • Single-quoted strings, unquoted keys and curly “smart quotes” from word processors.
  • Python literals like True and None, and JavaScript values JSON doesn't have: NaN, Infinity and undefined.
  • Number forms such as .5, +1, 0x1F and 1_000, and leading zeros like 01234.
  • Raw tabs or line breaks inside strings, unknown escapes like \d, and invisible characters such as a non-breaking space or a byte order mark.
  • Structural slips: a missing comma between items, a missing colon, a bracket that is never closed or one that closes the wrong container.

One-click repair that keeps your formatting

The Repair tab lists every fixable issue. Safe fixes, and fixes that change a value (such as NaN becoming null), are ticked by default. Guesses, such as appending the closing brackets of a truncated document, wait for you to tick them. Fixes edit the text in place, so your indentation and everything else stay as they were. You can also re-indent the result with 2 spaces, 4 spaces or tabs, or minify it. The formatter copies numbers and strings exactly as written and keeps key order and duplicate keys, which a JSON.stringify(JSON.parse(text)) round trip would not.

Valid, but risky: warnings worth reading

Some documents are valid JSON but still cause bugs. A duplicate key keeps the last value in JavaScript, but other parsers may keep the first one or reject the document. Integers above 9,007,199,254,740,991 (Number.MAX_SAFE_INTEGER) lose precision in any parser that uses 64-bit floats. This is a common source of corrupted IDs, so the validator shows the value JavaScript will actually read. It also flags very deep nesting, unpaired Unicode surrogates and Windows paths whose \n or \t quietly turn into control characters.

Big numbers
If an ID or amount is larger than 2^53, send it as a string. Otherwise every JavaScript client will round it without telling you.

JSONC, JSON Lines and JSON Schema

JSONC mode accepts the comments and trailing commas allowed in tsconfig.json and VS Code settings, and keeps every other rule strict. JSON Lines mode checks a .jsonl or .ndjson file line by line and counts valid, invalid and blank lines. Turn on schema validation to check the document against a JSON Schema (draft-06, draft-07, 2019-09 or 2020-12). Each schema error points to the exact key or value in your document, such as a missing required property, a wrong type or a property that isn't allowed.

See the structure of valid JSON

When the document is valid, the Structure tab counts values by type and shows the maximum depth, the largest array and the longest string. It also draws a collapsible tree. Click any row to select that value in the editor, or copy its JSON Pointer (/items/0/price) or JSONPath ($.items[0].price).

Private by design
Everything runs in your browser. The tool makes no network requests and never stores your document, so it is safe to check API responses that contain tokens or personal data.

Frequently Asked Questions

Is the JSON Validator free?

Yes, JSON Validator is totally free :)

Can I use the JSON Validator offline?

Yes, you can install the webapp as PWA.

Is it safe to use JSON Validator?

Yes, any data related to JSON Validator only stored in your browser (if storage required). You can simply clear browser cache to clear all the stored data. We do not store any data on server.

Why is my JSON invalid when it works as a JavaScript object?

JSON is a much stricter subset of JavaScript object syntax. It has no comments, trailing commas, single-quoted strings, unquoted keys, NaN, Infinity or undefined, and every one of those is reported here with a one-click fix where the fix is unambiguous.

Does JSON allow comments or trailing commas?

No. JSONC, the format used by tsconfig.json and VS Code settings, allows both, and JSON5 allows even more. Switch to JSONC mode to accept comments and trailing commas while every other rule stays strict.

My JSON is valid, so why do I see warnings?

Some valid JSON behaves differently across parsers. Duplicate keys keep the last value in JavaScript but the first or an error elsewhere, and integers above 2^53 (9,007,199,254,740,991) lose precision in any parser that uses 64-bit floats, so IDs that large should be sent as strings.

What is the difference between checking syntax and validating against a JSON Schema?

Syntax checking only asks whether the text is well-formed JSON. A JSON Schema describes what the data must contain, such as required properties, types, number ranges and formats, so a document can be perfectly valid JSON and still fail its schema.

Which JSON Schema drafts are supported, and why can't a $ref point to a URL?

Draft-06, draft-07, 2019-09 and 2020-12 are supported through Ajv. Remote $ref URLs are never fetched because the tool makes no network requests, so paste the referenced schema into $defs and point the $ref at #/$defs/… instead.

Is my JSON uploaded or stored anywhere?

No. Parsing, repair and schema validation all run in your browser, nothing is sent to a server, and the document text is never written to local storage or the URL. Only your mode and duplicate-key preference are remembered.