Tool guide
About this tool.
JSONC is JSON with // and /* */ comments and trailing commas, as used by tsconfig.json and VS Code settings. The converter removes comments and trailing commas outside strings and formats the result as strict JSON.
JSON5 mode also accepts single-quoted strings, unquoted keys, hexadecimal numbers, leading or trailing decimal points, + signs and line continuations in strings. Each is rewritten to its strict JSON form.
Paste JSONC or JSON5, or choose a sample.
Choose JSONC for comments and trailing commas, or JSON5 for the full JSON5 syntax.
Pick 2 spaces, 4 spaces or tabs.
Copy the result or save it as a JSON file.
- { "a": 1, // note } → {"a": 1} formatted, with 1 comment removed.
- [1, 2,] → [1, 2] without the trailing comma.
- {a:'x', b:0x1F, c:.5} in JSON5 mode → {"a": "x", "b": 31, "c": 0.5}.
- {"url": "http://x"} → the // inside the string is kept.
- Processing is local; nothing is uploaded.
- Limits: 5,000,000 input characters, 2,500,000 values and 128 nesting levels.
- Octal escapes such as \1 are rejected, as JSON5 requires.
- Duplicate keys are kept as written; the summary counts them.
- Infinity, -Infinity and NaN are rejected because JSON has no equivalent.