Skip to content
Toolew.com

JSON Validator

Check JSON syntax as you type, with the exact line and column of each error and warnings for duplicate keys.

Runs in your browser. Your data is not uploaded.
Loading tool…

This guide is not yet available in your language and is shown in English.

Tool guide

What this tool does

JSON Validator checks text against the JSON standard while you type. Invalid input shows a plain-language reason, the line and column, a code excerpt and a button that jumps to the problem in the editor; valid input shows counts of objects, arrays, keys and values plus warnings for duplicate keys and unsafe integers.

A single missing comma or stray quote makes a whole JSON document unreadable, and the message most programs give, such as “Unexpected token } in JSON at position 4187”, leaves you counting characters. In a large configuration file or API payload, finding that position by eye is slow and frustrating.

This validator implements the RFC 8259 grammar with a diagnostic parser built for explanations rather than speed alone. It names the actual mistake (a trailing comma, a single-quoted key, an unescaped line break inside a string, a leading zero, a missing closing bracket) and shows the line and column with an excerpt. It also flags things that are technically valid but risky: keys repeated in the same object and integers above 9,007,199,254,740,991 that JavaScript cannot represent exactly. Validation happens on your device.

How to use JSON Validator

  1. Paste JSON into “JSON to validate”, open a file, or click Sample to see an example with an error.
  2. Read the result below the editor: a green “Valid JSON” message or a red box with the reason and position.
  3. Click “Show in editor” to place the cursor on the error, fix it, and watch the result update.
  4. Choose Validation rules in Options: Strict JSON for APIs, or Relaxed to accept comments and trailing commas.
  5. Turn on “Treat duplicate keys as errors” if your system rejects repeated keys.
  6. Review the statistics and the Warnings list, and click any line:column link to jump to it.

Tips for better results

  • Errors are reported at the first problem only. After fixing it, re-check, because a missing bracket can hide later mistakes.
  • If the reported line looks correct, look at the end of the previous line: a missing comma is detected where the next value starts.
  • Configuration formats such as tsconfig.json allow comments; validate those in Relaxed mode.
  • Integers above 2^53 − 1 should be sent as strings if the consumer is a browser or Node.js application.

Common use cases

  • Finding why an API rejects a request body with a 400 “malformed JSON” error.
  • Checking hand-edited translation files or feature flags before deployment.
  • Confirming that an exported dataset is complete and not truncated.
  • Reviewing webhook payloads for duplicate keys that different parsers treat differently.

Common mistakes to avoid

  • Treating JSON as JavaScript: undefined, NaN, comments and trailing commas are all invalid in strict JSON.
  • Copying JSON from a chat app that replaced straight quotes with curly “smart” quotes, which are not valid delimiters.
  • Assuming a valid document has the right shape. Syntax validation does not check required fields; use a JSON Schema for that.

Frequently asked questions

Which standard does the validator follow?

Strict mode follows RFC 8259 and ECMA-404, the current JSON specifications. Relaxed mode additionally accepts comments, trailing commas, single quotes and unquoted keys, as used by JSONC and JSON5 files.

Are duplicate keys invalid JSON?

The specification says names within an object should be unique but does not forbid duplicates, so they are reported as warnings by default. Most parsers keep the last value, which can silently hide data.

Why do you warn about large numbers?

JavaScript stores numbers as 64-bit floating point values, so integers above 9,007,199,254,740,991 are rounded. A 19-digit order ID can change its last digits when parsed in a browser.

Does the validator check against a JSON Schema?

It checks syntax and structure. To describe the expected fields and types, generate a schema with the JSON Schema Generator and validate it with a schema-aware library.

Related articles

Feedback & suggestions

Help us improve JSON Validator. We read every message.

Rating (optional)
Necessary
Required for security, language and theme preferences. Always on.