DataPurge.dev

Remove Comments from JSON (JSONC → JSON)

Strip // single-line and /* */ block comments from tsconfig.json, VS Code settings, and JSONC configs into strict valid JSON.

Zero tracking • Runs entirely in your browser
Raw / Dirty InputJSON Detected
209 chars•11 lines•209 B
Sanitized OutputValid JSON
107 chars•8 lines•107 B(-49%)
Fixes applied:
✓ 2 comments removed
Live Telemetry & DiagnosticsLive
Sanitizer & Repair
Data Processed
209 B
209 chars
Errors Fixed
2
Syntax & hidden chars
Size Optimization
-49%
102 B saved
Processing Time
< 1 ms
Local engine
Privacy Score
100 / 100
Zero data leaves browser

Stripping Comments from JSONC and Configuration Files

Developers love adding comments to configuration files like tsconfig.json, .eslintrc, and VS Code settings.json. However, standard JSON does not support comments—causing deployment scripts, CI pipelines, and API tools to fail when given commented JSON.

Why does this error occur?

Douglas Crockford intentionally omitted comments from the original JSON specification so comments could not be abused as parsing directives. Tools like TypeScript and VS Code use a relaxed superset called JSONC (JSON with Comments), which permits // and /* */ comments.

When you copy a JSONC config into a strict consumer—such as jq, Python’s json module, AWS CloudFormation, or an API body—the parser throws a syntax error the moment it hits a forward slash.

How is it solved?

Paste your commented JSON or JSONC file into DataPurge above. With the comment-removal filter enabled, the parser carefully strips // inline comments and /* ... */ multi-line block comments while preserving URLs like "https://..." inside quoted strings.

It then cleans up any leftover trailing commas and validates the final output as strict, production-ready JSON.

Why should you use 100% Client-Side (Zero-Telemetry)?

Configuration files often reveal internal hostnames, port mappings, feature flags, and infrastructure architecture. Keeping those configs inside your browser tab guarantees zero leakage.

DataPurge runs 100% locally in JavaScript memory with zero external network calls.

No Compiler CrashesStrips zero-width spaces (\u200B) and curly quotes copied from Notion, Slack, or ChatGPT that secretly break your code.
100% In-Browser PrivacyNo API calls, no backend, no analytics trackers. Your proprietary code and tokens never touch any server.
Multi-Format EngineEffortlessly switch between JSON, YAML, XML, and CSV with automatic structure detection and clean syntax formatting.

Specialized Developer Utilities & Guides

All-in-One Sanitizer