JSONC to JSONONLINE

Remove comments and trailing commas from JSONC and produce strict JSON.

1 MiB per input · Ctrl / ⌘ + Enter to run

JSONC comments and trailing commas are accepted; invalid structure and duplicate names are rejected. Numeric token spelling stays intact.

Result
Ready. Paste input, then run the tool.
Your JSON stays in your browser. Core processing happens locally.
THE PRACTICAL GUIDE

Remove JSON comments and trailing commas safely

JSONC to JSON converts commented JSON-style configuration into strict JSON. It removes syntax extensions that a standard JSON parser rejects.

When should you use it?

  • Share an editor settings file with a strict JSON API.
  • Strip explanatory comments from a configuration example.
  • Remove trailing commas before validation.
WORKED EXAMPLE

Example: remove JSONC-only syntax

Comments and the trailing comma disappear; the value remains true.

JSONC input
{ // note
 "ready": true,
}
Strict JSON
{"ready":true}

Comment markers inside strings are ordinary data

A URL can contain // and a message can contain /* without either starting a comment inside a quoted string. A JSONC parser tracks strings and syntax before removing comments, avoiding the corruption a broad regular expression can cause. The tool also accepts trailing commas, then checks that the result follows strict JSON grammar.

JSONC support does not imply JavaScript expression support

Unquoted names, single-quoted strings, functions, and arbitrary expressions are outside this conversion. Use the original configuration format when comments need to be maintained by people, and generate strict JSON for a consumer that requires it. Keep the commented source separately, because the converted document cannot reconstruct the explanations once they have been removed.

IN PRACTICE

How do I remove comments and trailing commas from JSONC?

Paste a commented JSONC configuration and convert it to strict JSON. The parser accepts comments and trailing commas, then emits the same data without those extensions. Use the result with APIs and libraries that require ordinary JSON.

JSONC input with a comment and trailing comma

jsonc
{
  // Enable the staging feature.
  "enabled": true,
}

The strict output is {"enabled":true} after formatting. A standard JSON parser rejects the input because of the comment and final comma.

No. Unquoted names, single-quoted strings, and other JavaScript extensions are outside this JSONC subset. Use Repair for a reviewed suggestion when the input is not valid JSONC.

BEFORE YOU USE THE RESULT

What should you check before using the result?

This is not a general JavaScript object parser or JSON5 converter. Malformed structure and duplicate names fail instead of being guessed or overwritten.

Understand JSON syntax

Technical reference: JSONC parser options and supported syntax

THE JSON FIELD GUIDE
All guides