BYTETOOLS

JSONC to JSON Converter

Convert JSONC to strict JSON online. Strips // and /* */ comments and trailing commas without ever touching text inside string literals.

Drop a .jsonc or tsconfig.json file here or click to browse

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. 1

    Paste your JSONC, or drop a .jsonc or tsconfig.json file onto the drop zone.

  2. 2

    Choose whether to convert single quotes to double quotes, quote unquoted keys, and pretty-print the result.

  3. 3

    Click Convert to strict JSON.

  4. 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