JSON to TOML Converter

Turn a JSON object into a TOML document with tables, arrays of tables and dates.

Loading tool…

About the JSON to TOML

The JSON is checked first, and an error names the line and column. Then each nested object becomes a table ([server]), nested deeper as [server.tls], and an array of objects becomes an array of tables ([[workers]]). Plain values are written before the tables of the same object, as TOML requires, so the order of keys can change. Keys that are not bare keys are quoted: "key with space". Arrays may mix types, which TOML allows since version 1.0.

Some JSON cannot be written as TOML. A TOML document is a table, so the top-level value must be an object: an array or a string gives an error that says so. TOML has no null: by default the tool stops and names the path of the value, such as $.database.password, or you can choose to leave those keys out. Whole numbers are written as integers and numbers with a fraction as floats, and integers beyond 253 are written as floats because they cannot be exact.

With Date strings → TOML dates, strings that are valid RFC 3339 values are written as TOML dates without quotes: 2026-09-28T17:42:09Z (offset date-time), 2026-09-28T17:42:09 (local date-time), 2026-09-28 (local date) and 17:42:09 (local time). Turn the option off to keep them as strings. The conversion uses smol-toml and runs in your browser.

How to use it

  1. Paste a JSON object or open a .json file.
  2. Choose what happens with null values and with date strings.
  3. Copy the TOML or download converted.toml.
  4. Use Swap to convert the result back to JSON.

Frequently asked questions

Why does my JSON array give an error?
A TOML document is always a table of keys and values, so it cannot start with an array. Wrap the array in an object, for example {"items": [ … ]}.
How is null converted?
TOML has no null value. Choose "Omit the key" to leave out keys and array items that are null, or replace them with a value such as an empty string before converting.
Why did the order of my keys change?
In TOML, everything after a [table] header belongs to that table. The plain values of an object must therefore be written before its nested tables.

Related tools