JSON Comment Stripper

Convert JSONC files (with comments) into strict JSON ready for any parser. The stripper preserves whitespace and key order.

Input

Waiting for input
1

Output

1

Instant

Runs entirely in your browser — no upload, no wait.

100% private

Your JSON never leaves the tab. Nothing is logged.

No signup

Free, unlimited, no account required.

JSON vs JSONC

Strict JSON has no comments. JSONC (used by VS Code, tsconfig.json, and many config files) allows // line comments and /* */ block comments. Strict consumers — REST APIs, schema validators, message queues — reject JSONC outright.

Why a regex is not enough

A naive regex strips comment characters that legitimately appear inside string values. The stripper tokenizes first so a string like "https://example.com" is preserved exactly and only real comments are removed.

CLI alternative

For batch processing in CI, the strip-json-comments npm package or jq with the right filter does the same job at speed.

npx strip-json-comments-cli tsconfig.json > tsconfig.strict.json

Use cases

Sending tsconfig.json to a tool that does not accept comments, normalizing VS Code settings for sharing, preparing JSONC files for schema validation, building deterministic hashes of config files.

Privacy

Pure client-side. No upload.

Related tools

Frequently asked questions