JSON Validator
Runs 100% in your browserValidate JSON online with precise line and column diagnostics, targeted repair hints, structure inspection, and browser-only processing — no upload, no account.
Paste or open JSON
Validation result
What to fix
——Check the highlighted area and validate again.
Document structure
Recent validations
Recent validations appear here (session only).
Frequently asked questions
A JSON validator checks whether a text document follows standard JSON syntax rules (RFC 8259). It verifies double-quoted property names, correctly escaped strings, commas between values, colons between keys and values, balanced brackets and braces, and valid scalar types — before another application, API, or database consumes the document.
Paste your JSON into the input field, or open a local .json file. ToolsSonic parses the document in your browser using JSON.parse and immediately reports Valid JSON with document statistics, or Invalid JSON with the first error message, line number, column position, source context, and a targeted repair hint. Enable "Validate while typing" to get live feedback as you edit.
A JSON parse error means the browser's JSON.parse engine found a character that violates JSON syntax. Common causes include a missing comma between properties, a trailing comma before } or ], single quotes instead of double quotes, an unquoted key, an unfinished string, a JavaScript comment, an undefined or NaN value, or unbalanced brackets. The validator shows the error message, line and column, surrounding source context with a caret marker, and a specific repair hint for the most common patterns.
No. Standard JSON does not allow a trailing comma before a closing brace } or bracket ]. Trailing commas are valid in JavaScript object literals but JSON.parse rejects them. Remove the final comma, or use JSON Repair if the source is JavaScript-style with multiple extensions.
No. All JSON strings and property names must use double quotes. Single-quoted values are JavaScript syntax and are not accepted by JSON.parse or any RFC 8259 compliant parser.
No. Standard JSON does not define line comments (//) or block comments (/* */). If your configuration format supports comments (JSON5, JSONC, HJSON), remove them before validating strict JSON, or use a parser that targets that specific format.
ToolsSonic extracts the character offset from the browser's error message when the engine exposes one, then converts it to a line number and column, shows up to five surrounding lines, and places a caret under the reported character. Browser engines vary in error message format, so the location is a precise diagnostic aid rather than a guaranteed formal grammar position — but it correctly identifies the problem in the vast majority of real-world errors.
Yes. Copy the raw response body from your browser DevTools Network tab, a curl output, or an API client into the validator. ToolsSonic checks whether it is valid JSON before you pass it to JSON.parse, a database import, or a schema validator. Syntax validation confirms the format is correct — it does not check whether the response has the fields your application expects.
JSON syntax validation checks whether the document follows the JSON grammar: correct quotes, commas, brackets, and value types. JSON Schema validation checks whether a valid JSON document conforms to a defined schema — required properties, data types, value ranges, string patterns, and additional constraints. ToolsSonic's JSON Validator handles syntax. Use the JSON Schema Validator for schema conformance.
Native JSON.parse accepts duplicate object keys with implementation-defined last-value behavior rather than rejecting them as a syntax error. ToolsSonic reports what JSON.parse reports. If key uniqueness matters for your workflow, use a duplicate-key-aware parser or linter in addition to syntax validation.
After a valid parse, the Inspect structure tab shows the top-level type (Object, Array, String, Number, Boolean, or Null), total object keys, array items, maximum nesting depth, and counts of every scalar type (strings, numbers, booleans, nulls) across the entire document. It also lists the first 40 JSON paths so you can quickly see the shape of an API response or configuration file.
Yes. Click Open file and select a local .json or .txt file. The browser reads it with the FileReader API entirely in memory. The file is not sent to a server, no upload endpoint is contacted, and no data is written to localStorage or any persistent storage.
Yes. All validation uses the browser's built-in JSON.parse. There are no network requests, no upload endpoints, no analytics on your input, and no localStorage writes. Clipboard access is requested only when you click Paste. The validation report is generated and downloaded locally.
Use JSON Formatter to make the document readable with consistent indentation and optional key sorting. Use JSON Minifier to strip presentation whitespace for a transport payload. Use JSON Schema Validator to check required fields and data types. Use JSON Diff to compare it with another version. A passing syntax check confirms the document is structurally valid JSON — it does not guarantee that values are safe, complete, or semantically correct for your application.
JSONLint.com is a long-established online JSON validator that validates on form submission. ToolsSonic validates in real time as you type, shows a source context excerpt with a caret marker, provides targeted repair hints for the most common error patterns, and includes a structure inspection panel with type statistics and path preview. All processing is browser-only with no server submission required.
What is JSON Validator?
JSON (JavaScript Object Notation) is the universal data interchange format for web APIs, configuration files, database records, and developer tooling. Despite its apparent simplicity, JSON has a strict grammar defined in RFC 8259, and even a single misplaced character — a trailing comma, a single quote, a missing bracket — causes every compliant parser to reject the entire document with a cryptic error message.
What a JSON validator does
A JSON validator submits your text to a JSON parser and reports the result: either a confirmation that the document is syntactically valid, or an error message that describes what the parser found and where it stopped. ToolsSonic's validator uses the browser's native JSON.parse, the same engine your JavaScript application uses, so a passing result means the document will parse successfully in the same environment.
Line and column error positioning
The most common frustration with JSON error messages is that they report a character offset ("position 142") instead of a human-readable location. ToolsSonic converts this offset to a line number and column, then displays up to five surrounding lines with a caret marker pointing at the exact character. This makes it possible to locate the error in a 500-line configuration file in seconds rather than counting characters manually.
Targeted repair hints
Different error patterns require different fixes. A trailing comma before } needs to be removed, not added to. A single-quoted string needs both quotes changed to double quotes. An "Unexpected end of JSON input" error means a bracket or string was never closed. ToolsSonic recognises the most frequent error patterns — trailing comma, unexpected closing token, single quotes, undefined/NaN values, unfinished input, missing property name — and provides a specific, actionable repair instruction alongside the error context.
Structure inspection
After a valid parse, the Inspect structure tab reports the top-level type, total object keys, array items, maximum nesting depth, and a count of every scalar type in the document. It also lists the first 40 JSON paths, giving you an instant schema sketch of an API response or configuration file without needing a separate viewer.
Common JSON errors explained
*Trailing comma:* {"a":1,} — JSON does not permit a comma before } or ]. Remove the final comma.
*Single quotes:* {'key':'value'} — All strings and property names require double quotes.
*Comments:* {"a":1 // comment} — Standard JSON has no comment syntax. Remove comments or switch to JSONC, JSON5, or HJSON.
*Undefined / NaN / Infinity:* These are JavaScript values with no JSON equivalent. Replace with null or a quoted string.
*Unquoted key:* {key:"value"} — Property names must be quoted: {"key":"value"}.
*Missing comma:* {"a":1 "b":2} — Each property pair must be separated by a comma.
Common use cases
- Validating API response bodies before passing them to JSON.parse
- Checking configuration files (package.json, tsconfig.json, .eslintrc) for syntax errors
- Debugging 400 Bad Request errors caused by malformed JSON request bodies
- Verifying CI/CD pipeline JSON output before deployment
- Learning JSON syntax by seeing exactly where and why errors occur
- Validating webhook payloads and event data before database insertion
- Pre-flight check before importing JSON data into MongoDB, PostgreSQL, or a NoSQL store
Why use ToolsSonic's JSON Validator?
ToolsSonic's JSON Validator is the most useful free alternative to JSONLint.com for three reasons.
First, it validates in real time as you type — no form submission, no page reload, no waiting. The result updates within milliseconds of every keystroke so you can edit and fix errors interactively.
Second, it shows a source context excerpt with a caret marker. Instead of just saying "position 142", it shows you the five lines around the error with an arrow pointing at the exact character — the same experience developers get in a terminal or IDE, but in the browser.
Third, it provides targeted repair hints. For the most common patterns — trailing comma, single quotes, unexpected closing brace, unfinished input, undefined values — the page tells you specifically what to remove or change, not just where the error is. After fixing the error, click Open JSON Repair for carefully reviewed automatic correction of JavaScript-style extensions. Click Open JSON Formatter to make the valid document readable.
All processing uses the browser's native JSON.parse. No input is uploaded, no network request is made, and nothing is written to localStorage. You can safely validate JSON containing API keys, authentication tokens, private configuration, or personally identifiable data.
Related tools
JSON Formatter
Editor's choiceFormat, beautify, minify, and validate JSON locally. Choose indentation, sort keys, preserve Unicode, inspect statistics, and copy or download clean output.
JSON Repair
Editor's choiceRepair broken JSON in your browser with conservative, transparent fixes for trailing commas, comments, single quotes, and bare keys — review every change, export only when valid.
JSON Schema Validator
Editor's choiceValidate a JSON instance against a JSON Schema locally — Draft 4/6/7 and 2020-12 common subset, path-aware errors by keyword, type, format, required, composition, and local $refs. 100% browser-only, no upload.
JSON Diff
Editor's choiceCompare two JSON documents locally with path-aware added, removed, and changed reporting for nested objects, arrays, and primitives — both inputs stay in your browser.
JSON Minifier
Editor's choiceMinify and compress JSON online — remove whitespace, sort keys, escape Unicode, measure exact byte savings, and download compact JSON privately in your browser without any upload.