JSONC Validator
Drop any .jsonc or .json file to instantly validate its structure. Strips single-line (//) and multi-line (/* */) comments plus trailing commas, then validates the resulting JSON. Reports depth, node count, root type, encoding issues, and previews the top-level structure. Nothing leaves your browser.
JSONC File
Drop a .jsonc or .json file here, or
Supports .jsonc and .json files up to 50 MB
⛔
Wrong file type — only .jsonc or .json files are supported. You dropped a file.
Validation Errors
Warnings
✓ Valid JSONC
Top-level Keys
Structure Preview (top-level)
How It Works
1
Drop your JSONC fileDrag it onto the drop zone or click "browse" to select it. Supports
.jsonc and .json files.2
Comment stripping & parseSingle-line (
//) and multi-line (/* */) comments are removed, trailing commas are stripped, then the result is parsed with the native JSON parser for maximum accuracy.3
Review the reportGet a pass/fail result plus full stats: root type, node count, max depth, file size, line count, comment count, and a top-level structure preview.
What Gets Validated
- Comment stripping — safely removes
//single-line and/* */multi-line comments without touching strings that happen to contain those sequences. - Trailing commas — strips trailing commas from objects and arrays (a JSONC extension), making it valid for strict JSON parsers.
- JSON structure — validates the cleaned content with the native browser JSON parser, reporting the exact error message and position on failure.
- Encoding issues — detects a UTF-8 BOM (byte order mark) and null bytes indicating binary content or wrong encoding.
- Depth analysis — measures the maximum nesting depth of the structure, flagging extremely deep trees that may cause stack overflows in some parsers.
- Duplicate keys — checks objects at every nesting level for repeated keys, which produce undefined behaviour in most parsers.
- File statistics — reports root type, total nodes, max depth, top-level key count, comment count, line count, and file size.
- Structure preview — renders the top-level keys and their value types so you can visually confirm the shape of your data.
🔒 Privacy & Security
All validation is performed locally using the Web File API and the FileReader API. Your JSONC data is never sent to a server. Suitable for sensitive configuration files, secrets, API responses, or any private structured content.
