Skip to content

JSON validator with exact error positions

Find the exact line, column and cause of a JSON error, then fix trailing commas, single quotes and comments in one click. Nothing is uploaded.

  • Runs in your browser
  • Files are never uploaded
  • Free, no account
Validate JSON
Paste JSON and get the exact line, column and cause of the first problem — plus a one-click repair for the mistakes that cause almost every failure.
Your JSON never leaves this tab — check it yourself—

Starting the network probe…

The counter above wraps fetch, XMLHttpRequest and navigator.sendBeacon in this tab and counts every call. It does not block anything — it just reports.

Two ways to verify independently

  1. Turn off Wi-Fi or enable airplane mode, then use the tool. It keeps working, because the page is already fully loaded.
  2. Open your browser devtools, switch to the Network tab, clear it, and run the tool. No new row appears.

Why this matters

In 2025 researchers found that popular online formatters had retained tens of thousands of user-submitted snippets — JSONFormatter.org and CodeBeautify together exposed roughly 80,000 saved documents, many containing live cloud credentials, private keys and internal database connection strings, because “format this” quietly meant “upload this”. A separate incident exposed roughly 3.5 million user PDFs on a document-conversion service. The only structural fix is not sending the data in the first place: this site is served under a Content-Security-Policy whose connect-src contains no third-party origin, so a request off this device cannot be made even by accident.

Reading the error message

JSON is a deliberately tiny grammar, so a failure is always one of a short list of causes. The validator reports three things: what it expected at that point, what it actually found, and the line and column — then prints the offending line with a caret under the exact character. That is more than JSON.parse gives you, and it is consistent across browsers, which the built-in messages are not.

What you wroteWhy it failsFix
{"a": 1,}Trailing comma before the closing braceDelete the comma
{'a': 1}Single quotes are not JSON stringsUse double quotes
{a: 1}Unquoted keyQuote every key
{"a": 01}Leading zeros are not valid numbersWrite 1
{"a": 1.}A decimal point needs a digit after itWrite 1.0
{"a": NaN}NaN and Infinity are JavaScript, not JSONUse null or a string
// noteJSON has no commentsStrip them, or use JSONC in your own tooling
{"a": "b
c"}
A raw line break inside a stringEscape it as \n
"C:\path"A lone backslash starts an escapeDouble it: "C:\\path"
Starts with <An HTML error page arrived instead of JSONCheck the request, not the JSON

What the one-click repair changes

The repair pass is a single left-to-right rewrite that is string-aware: anything between a pair of quotes is copied verbatim, so a comma inside "Doe, Jane" is never mistaken for a trailing comma. Each category is counted before you commit, so you can see exactly what will change:

  • A byte-order mark before the first character (invisible, and a very common cause of “unexpected token” at position 0).
  • Single-quoted strings converted to double quotes, with any internal double quotes escaped.
  • Typographic “smart quotes” from a word processor or a chat app replaced with straight ones.
  • //, # and /* … */ comments removed.
  • Trailing commas before } or ] removed.
  • NaN, Infinity and undefined replaced with null.
  • Bare object keys wrapped in double quotes.

Repair rewrites your input in place, so re-validation happens immediately. If the result is still invalid, the remaining error is a structural one — an unclosed bracket, or two documents concatenated — and needs a human.

Two warnings that appear on valid documents

Duplicate keys. {"a": 1, "a": 2} is legal JSON. Every mainstream parser keeps the last occurrence and discards the first, silently. In a config file that means an override you did not intend; in an API payload it usually means two code paths both wrote the same field. The validator names the key and the line.

Unsafe integers. JavaScript numbers are IEEE-754 doubles, so any integer above 9,007,199,254,740,991 loses precision. A 19-digit Snowflake or Twitter-style ID will round to a different number the moment it is parsed — and it will do so silently, in both directions. The standard fix is to transmit large identifiers as strings.

Why validating locally matters here more than most places

The JSON people validate is, almost by definition, a payload that is not working — which means it is usually a real request or a real response, complete with bearer tokens, customer records, internal identifiers and webhook secrets. In 2025, roughly 80,000 saved snippets were recovered from public formatter sites, many containing live cloud credentials. This page parses in your tab; the panel under the tool counts every network request the page makes so you can confirm it is zero.

Questions

How is this different from pasting into a browser console?

`JSON.parse` gives you one message whose wording differs between browsers and whose position is a raw character offset. This page runs its own parser that reports what it expected, what it found, and the line and column — then prints the offending line with a caret under the exact character.

What does the repair button actually change?

Six things, each counted separately before you commit: a byte-order mark, single-quoted strings, typographic “smart quotes”, // and /* */ comments, trailing commas before a closing bracket, and the JavaScript-only literals NaN, Infinity and undefined (replaced with null). It also quotes bare object keys. Anything inside a string literal is never touched.

Why does it warn about duplicate keys when the JSON is valid?

Because duplicate keys are legal JSON but almost never intentional. Every mainstream parser keeps the last occurrence and silently discards the earlier value, so a config file with the same key twice behaves differently from what it looks like.

What is the warning about large integers?

JavaScript numbers are IEEE-754 doubles, so any integer above 2^53 loses precision. A 19-digit database ID pasted into JSON will round. The validator flags it; the fix is to send large IDs as strings.

Does it validate against a JSON Schema?

No — this page checks syntax, not structure. If you want a schema, use the JSON to JSON Schema generator to derive one from a sample, then validate with your own tooling.