TOML to JSON Converter

Paste a TOML file, such as a configuration file or a Cargo.toml. The tool reads it by the rules of TOML 1.0.0 and writes the same data as JSON, or it tells you the line where a rule breaks.

Free Runs in your browser Checked Wednesday, November 11, 2026

The whole file. Keys, tables, arrays and values are read the way the specification writes them. Nothing is sent or stored.

Result

JSON — Copy it, or download it as data.json.
Check — Green when the document follows TOML 1.0.0. Red names the line and the rule it breaks.
JSON

This tool runs in your browser. What you enter is not sent to us.

How to use it

  1. Paste the TOML file into TOML document, or keep the example that is there.
  2. Read Check. Green means the file follows TOML 1.0.0. Red gives the line and the rule that the file breaks.
  3. Copy the JSON output, or download it as data.json.

How the conversion works

The reader follows the grammar of TOML 1.0.0 and builds the tree that the specification describes. The tree is then written as JSON with two spaces of indentation, and the keys keep the order of the file, so the JSON reads like the TOML.

  • A table and its sub-tables become JSON objects.
  • An array becomes a JSON array. An array of tables, which TOML writes with double brackets, becomes a JSON array of objects.
  • An inline table becomes a JSON object. Its keys stay in the order of the line.

What JSON cannot hold

  • A date, a time or a date with an offset becomes its text, such as "1979-05-27T07:32:00-08:00". JSON has no date type, and the text keeps the offset and every digit of the fraction.
  • An infinity or NaN becomes the string "inf", "-inf" or "nan", because JSON has no such number.
  • A float with no fraction, such as 1.0, is written as 1.0, and an integer such as 1 is written as 1. A JSON reader that knows only one kind of number reads both as the same number.

The rules the check follows

A file is refused as soon as it breaks a rule of the specification. These rules cause most of the errors:

  • A key can be defined only once. A bare key and a quoted key with the same name are the same key.
  • A table header defines its table once. A table that a longer header only implied can be defined later, but a table made by dotted keys or by an inline table cannot.
  • An array of tables grows by one table for each header written with double brackets. A static array, such as one written with an empty pair of brackets, cannot grow that way.
  • An integer is a signed 64-bit number, from -9223372036854775808 to 9223372036854775807.

Worked example: a date, a float and a big integer

Each row gives one line of TOML and the JSON value that the tool writes for it. Run the four lines together to see the same result in one output.

TOML line JSON value
when = 1979-05-27T07:32:00-08:00 "when": "1979-05-27T07:32:00-08:00"
ratio = 1.0 "ratio": 1.0
port = 8000 "port": 8000
id = 9223372036854775807 "id": 9223372036854775807

Frequently asked questions

Why is a date written as text in the JSON?

JSON has no date or time type, so the tool writes the text that the TOML file holds. The text keeps the offset and every digit of the fraction, so nothing is lost when the JSON is read.

Why does 1.0 stay 1.0 while 1 stays 1?

TOML tells an integer from a float by the point or the exponent, and the JSON keeps that difference in the digits it writes. Whether a JSON reader keeps the difference depends on that reader.

Why does the tool refuse a table that is defined twice?

TOML 1.0.0 lets a table header define its table once, and a key only once. The second definition is an error on the line where it is written, so the JSON never holds a value that the file contradicts.

Are comments and the order of the keys kept?

Comments are dropped, because JSON has no comments. The order of the keys is kept, since the members are written in the order of the file.

Can a TOML file with a multi-line array be converted?

Yes. An array may run over several lines and end with a comma, as TOML 1.0.0 allows, and the tool writes it as one JSON array.

Is the text I paste sent anywhere?

No. The conversion runs in your browser, and nothing you paste is stored or sent to us. Still, do not paste a password or a token into a page you do not trust.

Sources

Figures and text last checked on Wednesday, November 11, 2026.

We use necessary cookies to run the site. With your consent, Google also uses advertising cookies to show personalised ads. If you reject them, you still see ads, but they are not personalised.