JSONC to JSON Converter
Convert JSONC to strict JSON online. Strips // and /* */ comments and trailing commas without ever touching text inside string literals.
What is the JSONC to JSON Converter?
The ByteTools JSONC to JSON Converter turns JSON-with-Comments — the dialect tsconfig. json, .
- Removes // line comments and /* */ block comments
- Removes trailing commas before } and ]
- String- and escape-aware, so URLs and comment-like text survive
- Optionally converts single quotes and quotes bare keys
- Re-parses the result, proving the output is valid JSON
- 100% in-browser — the file is never uploaded
How to use the JSONC to JSON Converter
- 1
Paste your JSONC, or drop a .jsonc or tsconfig.json file onto the drop zone.
- 2
Choose whether to convert single quotes to double quotes, quote unquoted keys, and pretty-print the result.
- 3
Click Convert to strict JSON.
- 4
Review the counts of comments, trailing commas and re-quoted strings, then Copy or Download the clean JSON.
About the JSONC to JSON Converter
The ByteTools JSONC to JSON Converter turns JSON-with-Comments — the dialect tsconfig.json, .vscode/settings.json and devcontainer.json use — into strict RFC 8259 JSON. A character scanner removes // and /* */ comments and any trailing comma before a closing brace or bracket, tracking string literals and backslash escapes so a URL like "https://example.com" is never mistaken for a comment.
Two optional passes go further: single-quoted strings can be rewritten as double-quoted ones, and unquoted object keys can be quoted, which covers most hand-written JSON5-flavoured config. The cleaned text is then re-parsed and pretty-printed, so a successful result is proof the JSON is valid.
Everything runs 100% locally in your browser. Your file is never uploaded or stored, so editor settings, build configuration and anything else with internal paths in it stays entirely on your own machine.
Frequently asked questions
What is JSONC?
JSONC is JSON with comments, a relaxed dialect used by tsconfig.json, VS Code settings and devcontainer files. It allows // and /* */ comments and trailing commas, which strict JSON parsers reject.
How do I remove comments from tsconfig.json?
Drop the file onto the drop zone or paste its contents and click Convert to strict JSON. Every comment and trailing comma is removed and the result is re-parsed, so you know the output is valid before you use it.
Will it break a URL like https://example.com?
No. The scanner tracks when it is inside a string literal and honours backslash escapes, so the double slash in a URL, or a /* sequence inside text, is copied through untouched rather than treated as a comment.
Can it handle single quotes and unquoted keys?
Yes, if you leave those two options ticked. Single-quoted strings are re-emitted as proper double-quoted JSON strings and bare identifier keys are quoted, which covers most JSON5-style hand-written config.
What if the output still is not valid JSON?
The tool tells you so and shows the stripped text anyway, along with the parser's message. That usually means a genuine syntax error such as a missing brace, which the comment stripper cannot fix for you.
Related tools
JSON Formatter
Format, beautify and minify JSON online with 2-space, 4-space or tab indentation. Sort keys alphabetically and catch syntax errors instantly — free and private.
JSON Validator
Free online JSON validator: validate JSON and find syntax errors with the exact line and column. See root type, key counts and depth — instant and 100% private.
JSON Pointer Resolver
Resolve RFC 6901 JSON Pointers against any JSON document online, or list every valid pointer in the file with its value — all in your browser.
JSON to .env Converter
Convert JSON to a .env file online. Flattens nested keys with underscores, upper-cases names and quotes tricky values — nothing leaves your device.
JSON to YAML Converter
Convert JSON to clean block-style YAML online. Choose the indent width, sort keys, and keep numeric strings quoted — all inside your browser.