TOML to JSON

Convert TOML configuration into JSON.

The TOML to JSON converter parses TOML and shows the equivalent JSON, updating as you type. Use it to see how a configuration file such as pyproject.toml or Cargo.toml reads as plain data. Parse errors include the line and column.

What is TOML?

TOML (Tom's Obvious Minimal Language) is a configuration file format designed to map unambiguously to a hash table. It uses key = value pairs, tables written as [section] headers, arrays of tables written as [[section]], and typed values: strings, integers, floats, booleans, arrays, and date and time values. Version 1.0.0 is the current stable specification. Because TOML maps to nested key-value structures, it converts cleanly to JSON objects and arrays. The differences are types JSON lacks. TOML has native date and time values, which this tool writes as strings in JSON, for example a UTC date-time becomes 1979-05-27T07:32:00.000Z. TOML integers are 64-bit while JavaScript numbers are exact only to 2^53, so this tool refuses integers it cannot represent exactly. Comments starting with # are dropped.

How to use TOML to JSON

  1. Paste TOML Enter the TOML document in the TOML pane.
  2. Choose the indent Select 2 spaces or 4 spaces.
  3. Check the JSON The JSON pane updates automatically.
  4. Fix errors If the parser reports a problem, correct the line and column it names.
  5. Copy or download Copy the JSON or save it as output.json.

Frequently asked questions

What happens to dates?

TOML date and time values have no JSON type, so they are output as strings. Date-times with a time part are shown in ISO form with milliseconds.

Are comments kept?

No. JSON has no comments.

How are very large integers handled?

Integers that cannot be represented exactly as a JavaScript number are rejected with an error rather than silently rounded.

What is the difference between [a] and [[a]]?

[a] defines a single table. [[a]] adds an element to an array of tables.

Can I convert back to TOML?

Yes, with the JSON to TOML tool, within the limits of what TOML can express.

Is my data uploaded?

No. The conversion runs in the page and the text you enter is not sent anywhere.