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.