Convert TOML to JSON

Turn TOML files into JSON. The same tables and keys in their written order; dates and times become ISO 8601 text, infinity and NaN become null, and comments are dropped.

Converted in an isolated sandbox on our serversDeleted after 24 hours

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

Your TOML as JSON.The same tables and keys, in the order you wrote them.

  1. What you get

    One JSON file with the tables and keys of your TOML file. The keys keep their written order, so the JSON reads the way the original does.

  2. What changes

    JSON has no date or time type. Dates and times become text in ISO 8601 form.

    JSON has no infinity or NaN. Both become null.

    Comments are dropped, because JSON has no place for them.

  3. When it fails

    If the file cannot be parsed, the conversion stops with input_corrupted. This means the TOML is not valid, so there is nothing to convert.

    To go the other way, use JSON to TOML.

TOML and JSON.What each format is.

The formats

From · TOML

TOML

TOML configuration files, the format of Cargo and pyproject.

Extensions
.toml
MIME type
application/toml
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 TOML to JSON conversion through the API, for your app or your agent.

terminal
$ cv convert report.toml report.json
$ cv convert report.toml report.json

Questions.What people ask about TOML to JSON.

01OF 04

Yes. Tables and keys come out in the order they are written in the TOML file.

They become ISO 8601 text, since JSON cannot hold a date or time as its own type.

No. Comments are dropped from the JSON.

Both become null in the JSON.

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