Convert JSONC to JSON

Turn JSONC files into JSON. Comments and trailing commas are removed and everything else is kept in its order, including comment-like text inside strings.

Converted in an isolated sandbox on our serversDeleted after 24 hours

Drop JSONC files on the dialor turn it to pick what to do

JSONC becomes plain JSON.Comments and trailing commas are removed. Everything else stays in order.

  1. What you get

    One JSON file with the same content as your JSONC file. The keys and values keep the order they had in the source.

    Only the comments and the trailing commas are removed. Nothing else is changed.

  2. Text that looks like a comment

    Comment-like text inside a string is part of the value, so it stays. A string that holds a URL with two slashes, for example, is not cut short.

  3. When it fails

    If the file cannot be parsed, the conversion stops with input_corrupted. The conversion has no options to set.

    To go the other way, use JSON to JSONC.

JSONC and JSON.What each format is.

The formats

From · JSONC

JSON with Comments

JSON that allows comments, as in editor and TypeScript configuration files.

Extensions
.jsonc
MIME type
text/x-jsonc
Kind
Text and data
To · JSON

JSON

JSON, the data format of every API.

Extensions
.json
MIME type
application/json
Kind
Text and data

In your code.The same JSONC to JSON conversion through the API, for your app or your agent.

terminal
$ cv convert report.jsonc report.json
$ cv convert report.jsonc report.json

Questions.What people ask about JSONC to JSON.

01OF 04

Yes. Comments and trailing commas are removed, and everything else is kept in its order.

No. Text inside strings that looks like a comment is kept as it is.

No. Everything that is kept stays in its original order.

The file could not be parsed. The conversion stops and no JSON file is made.

More conversions.Other ways in and out of JSONC and JSON.