DataToolsLab
JSON Tools

JSONC to JSON (Comment Stripper)

Strip comments and trailing commas from JSONC/JSON5 config files.

Loading tool…

What is JSONC → JSON?

Parses JSONC/JSON5 text (like VS Code config files with comments and trailing commas), strips all comments and trailing commas, and outputs valid strict JSON.

How it works

A character-by-character scanner identifies and removes both single-line (//) and multi-line (/* */) comments. Trailing commas before } or ] are also removed. The result is validated with JSON.parse.

  1. Paste JSONC/JSON5. Paste config file content with comments and/or trailing commas.
  2. Review stripped output. The cleaned JSON is shown. If the result is still invalid, errors are reported.

Examples

Config file

// debug config { /* server */ "port": 8080, // trailing comma } → valid JSON.

Common mistakes

Unterminated comments

A /* without a matching */ reports an error at the end of the file.

Alternatives

JSON Validator

For validating already-strict JSON.

Frequently asked questions

Does it handle single quotes?

Not yet — the input should use double-quoted strings as per JSON standard.

Online