Skip to content
← All Tools
๐Ÿ”’All processing in your browser ๐ŸšซNo uploads stored ๐Ÿ›ก๏ธPrivacy-first conversion tools โœ“No login required
Tutorial

How to Use the Jsonc Validator: Step-by-Step Tutorial

Bill Crawford — Developer Tutorial — 2026  ยท  Published March 26, 2026

The Jsonc Validator runs entirely in your browser โ€” your configuration file is never sent to any server, no account is required, and nothing leaves your machine. This tutorial walks through every step of using the tool: loading a JSONC file, reading each results panel, understanding what the validator checks, and diagnosing the issues it reports.

Connect on LinkedIn โ†’

Follow along with the tool open: Open the Jsonc Validator in a second tab, then work through each step below.

Open Jsonc Validator โ†’

Table of Contents

  1. Step 1 โ€” Open the Tool
  2. Step 2 โ€” Load Your JSONC File
  3. Step 3 โ€” Click Validate
  4. Step 4 โ€” Read the Status Bar
  5. Step 5 โ€” Review the Error Panel
  6. Step 6 โ€” Review the Warnings Panel
  7. Step 7 โ€” Read the Valid JSONC Panel
  8. Step 8 โ€” Inspect the Structure Preview
  9. Worked Examples
  10. Tips and Edge Cases

Step 1 โ€” Open the Tool

Navigate to /developer-tools/jsonc-validator/. The tool loads entirely in the browser โ€” after the initial page load, validating a file makes zero outbound network requests. You can confirm this in your browser's DevTools Network panel: drop a file and watch the network tab remain idle.

The tool is accessible from the Developer Tools hub, the command palette (press Ctrl+K or โŒ˜K and type "JSONC Validator"), or directly via the URL above.

Step 2 โ€” Load Your JSONC File

There are two ways to load a file. The easiest is drag and drop: drag your .jsonc or .json file from your file manager and drop it anywhere on the drop zone. A full-page overlay appears when you drag a file over the browser window, making it easy to drop the file accurately. The drop zone accepts both .jsonc and .json files up to 50 MB.

Alternatively, click the "browse" link inside the drop zone to open a file picker dialog. Select your file and the tool loads it immediately.

If you drop a file with an unsupported extension, the tool displays a type error message identifying the extension and explaining why it was rejected. Common configuration file extensions that are not supported: .yaml, .toml, .env. Only .jsonc and .json files are accepted.

Once a file is loaded, its name appears in a bar above the buttons. To clear the file and load a different one, click the โœ• button in the filename bar.

Step 3 โ€” Click Validate

After loading your file, click the Validate JSONC button. Validation runs in JavaScript in your browser tab โ€” for most configuration files (under a few megabytes), results appear instantly. The button also clears any previous results from a prior validation run, so you can validate multiple files in sequence without reloading the page.

Clicking Clear removes the loaded file and resets the tool to its initial state.

Step 4 โ€” Read the Status Bar

After clicking Validate, a status bar appears below the buttons. It is colour-coded to give you an immediate answer:

Step 5 โ€” Review the Error Panel

If validation fails, a red Error panel appears below the status bar. It contains the full error message from the JSON parser or from the preprocessing step. Common error messages and what they mean:

"Unexpected token X in JSON at position N"

This is the native JSON parser's error for a structural problem in the cleaned content (after comments and trailing commas have been stripped). The token X is the character the parser found, and position N is the byte offset in the cleaned string where the parser stopped. Common causes:

To locate the error, divide position N by the approximate line length to estimate the line number, then look in that area of your file for the structural issue.

"Unexpected end of JSON input"

The file ends before the JSON structure is complete. The most common cause is an unclosed object or array โ€” a missing closing } or ] at the end of the file. In large configuration files, this is easy to miss. Count your opening and closing braces and brackets at the top level to find the imbalance.

"UTF-8 BOM detected"

The file begins with a UTF-8 byte order mark. While this is flagged as an error because it will cause strict JSON parsers to fail, some consumers may tolerate it. Re-save the file without the BOM using your editor's encoding settings (in VS Code: click the encoding indicator in the status bar and choose "Save with Encoding" โ†’ UTF-8 without BOM).

"Null bytes detected โ€” binary content or wrong encoding"

The file contains null bytes, which are not valid in a text file. This usually means the file is binary content mistakenly given a .jsonc extension, or it was saved in UTF-16 or UTF-32 encoding rather than UTF-8. Open the file in a hex editor to confirm the encoding, then re-save as UTF-8.

Step 6 โ€” Review the Warnings Panel

If warnings were detected, a yellow Warnings panel lists each one. Warnings do not prevent the file from being used โ€” the JSONC structure is valid โ€” but they flag conditions that may cause problems in specific contexts:

"Duplicate key 'X' in object at path Y"

A key appears more than once in the same object. The path Y identifies which object contains the duplicate โ€” for a top-level duplicate it may be root, for a nested duplicate it shows the key path like compilerOptions. Find both occurrences of the key in your file, determine which value is correct, and remove the other. Do not leave this warning unresolved โ€” duplicate keys produce silent, hard-to-diagnose bugs.

"Max nesting depth N exceeds recommended limit"

The structure is nested N levels deep, which is above the threshold the validator considers unusual (typically 10 or more). Review the deeply nested section and consider whether the structure can be flattened. If the depth is intentional and your JSONC consumer handles it correctly, you can ignore this warning โ€” it is informational.

"No content after comment stripping"

After removing comments, the file is empty or contains only whitespace. This means the file consists entirely of comments with no actual JSON content. This is unusual for a configuration file and likely indicates the wrong file was loaded, or the file is a template stub that hasn't been filled in yet.

Step 7 โ€” Read the Valid JSONC Panel

When a file passes validation (green or yellow status), a green "Valid JSONC" panel shows the file statistics extracted from the structure:

Step 8 โ€” Inspect the Structure Preview

For valid files, a second green panel shows the "Structure Preview (top-level)". This is a table of the top-level keys in the root object, with their value types โ€” Object, Array, String, Number, Boolean, or Null โ€” displayed alongside each key name.

Use this panel to quickly confirm:

The preview shows only the top-level keys. To inspect the values inside nested objects, you will need to open the file directly โ€” the preview is not a full tree view, just a quick top-level sanity check.

Worked Examples

Example 1: tsconfig.json failing to compile

Situation: Your TypeScript project's tsconfig.json was working yesterday, but today tsc is reporting a parse error and refusing to compile.

What to do: Drop the tsconfig.json into the Jsonc Validator. If the status bar shows red with a parser error like "Unexpected token } in JSON at position 342", the file has a structural error โ€” probably a missing comma after a new option someone added. Find the area around position 342 in the cleaned content (or look at recent changes in your diff) and fix the syntax.

If the status bar shows green, the JSONC syntax is correct and the problem is with a TypeScript compiler option value, not the file structure. Check the tsc error message more carefully โ€” it may be complaining about an unknown option name or an invalid value rather than a parse error.

Example 2: VS Code settings not applying

Situation: You edited your workspace settings.json to add a new extension's configuration, but the settings are not taking effect.

What to do: Drop settings.json into the Jsonc Validator. Check the Warnings panel for duplicate key warnings โ€” if the extension's configuration key already exists elsewhere in the file and you added it a second time, VS Code may be using the first occurrence, the second, or silently discarding one. Merge the duplicate entries. Also check the structure preview to confirm the extension's key is present at the top level with the correct type.

Example 3: ESLint config silently ignoring rules

Situation: You added new rules to your .eslintrc.jsonc, but ESLint is not enforcing them. No error โ€” it simply behaves as if the rules aren't there.

What to do: Drop the config file into the Jsonc Validator and check for duplicate key warnings. A common cause of silent rule-ignoring is a duplicate "rules" key โ€” ESLint uses one and silently discards the other. If you find a duplicate, merge both rules objects into a single "rules" block. The structure preview will confirm there is only one rules entry at the top level after the fix.

Example 4: Validating a generated configuration file

Situation: A scaffolding tool generated a tsconfig.json for a new project. You want to verify it is syntactically correct before starting to modify it.

What to do: Drop the generated file into the validator immediately. Auto-generated config files are usually correct, but some tools produce files with encoding issues (particularly BOM-prefixed files on Windows), non-standard comment syntax, or structural quirks. If the validator returns green with no warnings, the file is ready to use. If it flags a BOM or encoding warning, re-save without the BOM before proceeding.

Tips and Edge Cases

BC
Bill Crawford
Founder, Data Conversion Center

Bill Crawford is a data systems developer and technical founder with over 30 years of professional experience in accounting, finance, and business operations. He founded DataConversionCenter.com to build practical, browser-based tools that simplify complex data challenges.

Professional Background