Проверка JSON
В тренде 🔥Проверьте синтаксис JSON и отформатируйте его.
Как использовать Проверка JSON
- 1Вставьте JSON
- 2Нажмите Валидировать JSON
- 3Проверьте, является ли он корректным, или получите точное местоположение ошибки
- 4Если корректен, скопируйте форматированный JSON-вывод
О Проверка JSON
Валидатор JSON проверяет, является ли ваша JSON-строка синтаксически корректной. Если корректна, показывает разобранный и форматированный JSON-вывод. Если нет — отображает точное сообщение об ошибке с позицией синтаксической ошибки.
Ключевые возможности Проверка JSON
- Instant JSON syntax validation using the browser's native JSON.parse()
- Displays exact error message and position for invalid JSON
- Shows formatted, pretty-printed JSON output when valid
- Clear visual pass/fail indicator
- Works with any valid JSON value — objects, arrays, strings, numbers
- Works entirely in-browser — no server uploads
- One-click copy for the formatted output
- Handles large and deeply nested JSON documents
Примеры
Validate an API response before parsing in code
Confirm that a copied API response is valid JSON before using it in your application.
Входные данные
{"user":{"id":1,"name":"Alice"},"token":"abc123"}Результат
Valid JSON ✓ — formatted output displayed
Debug a configuration file with a syntax error
Find the exact location of a syntax error in a malformed config file.
Входные данные
{"host":"localhost","port":3000,}Результат
Invalid JSON — SyntaxError: Unexpected token } at position 32 (trailing comma)
Типичные сценарии использования
- Validating API response payloads before writing parsing code
- Checking JSON configuration files (package.json, tsconfig.json) for syntax errors
- Debugging webhook payloads that are failing to parse in your application
- Verifying data exports from databases or ETL pipelines
- Checking environment variables that contain JSON-encoded values
- Teaching JSON syntax by seeing clear, immediate error feedback
Устранение неполадок
Trailing comma after the last element
Решение
JSON does not allow trailing commas. Remove the comma after the last property in an object or the last element in an array.
Single quotes used instead of double quotes
Решение
JSON requires double quotes for all strings and property names. Replace all single quotes with double quotes.
Unexpected end of JSON input
Решение
A bracket or brace is not closed. Check that every { has a matching }, every [ has a matching ], and all strings are properly closed with double quotes.
Часто задаваемые вопросы
Does it fix invalid JSON?
No. The validator identifies the exact error but does not automatically repair the JSON. Use the error message and position to locate and fix the issue manually, then re-validate.
What errors are shown?
The exact JavaScript JSON.parse() error message is displayed, including the position (character index) where the syntax error was detected. This matches what your application code would receive.
What is the most common JSON syntax error?
Trailing commas after the last property or array element are the most common mistake, followed by single-quoted strings and missing closing brackets. JSON is strict — it follows RFC 8259 exactly.
Can it validate JSON Schema compliance?
This tool validates JSON syntax only. It does not check whether the data matches a JSON Schema (e.g., required fields, data types). For schema validation, use a dedicated JSON Schema validator.
Does it support JSON5 or JSONC?
No. This tool validates strict RFC 8259 JSON. JSON5 features like comments, trailing commas, and unquoted keys will cause validation to fail. Remove these extensions before validating.
Can I validate very large JSON files?
Yes. The validator uses the browser's native JSON.parse() which handles large files efficiently. Files over 10 MB may cause a brief delay, but there is no hard size limit.
Is my data sent to a server?
No. All validation is performed locally in your browser using JSON.parse(). Your JSON data never leaves your device and is not stored or transmitted anywhere.
Why does the error position not match my line number?
JSON.parse() reports the character position from the start of the string, not a line number. Count characters from the beginning of the JSON, or use the formatted output view which may make the issue visually apparent.