JSON to TOML Converter
Convert JSON to valid TOML 1.0 with tables and arrays of tables, explicit handling of null values and optional native dates.
This guide is not yet available in your language and is shown in English.
Tool guide
What this tool does
JSON to TOML Converter writes nested objects as [tables], arrays of objects as [[arrays of tables]] and simple values as key = value pairs. Because TOML has no null and must start with a table, it lets you choose how nulls and top-level arrays are handled, and can turn ISO 8601 date strings into native TOML dates.
Generating configuration from code is often easiest in JSON, but many tools expect TOML: Rust’s Cargo, Python’s pyproject.toml, Hugo, Netlify, Deno and others. The formats are close but not identical. TOML has no null value, a document must be a table rather than an array, and dates are a native type instead of strings, so a direct translation can fail or silently lose data.
This converter uses smol-toml to produce standard TOML 1.0. Nested objects become [section] tables, arrays of objects become [[section]] arrays of tables, and short arrays of values stay inline. You decide what happens to null values: leave the key out, write an empty string or stop with an error showing the exact path. A top-level array is stored under a key you choose, and strings in ISO 8601 date format can become unquoted TOML dates. Conversion happens locally.
How to use JSON to TOML Converter
- Paste JSON into JSON input or open a file; comments and trailing commas are accepted.
- Choose how null values are handled, since TOML cannot represent them.
- Set the Key for a top-level array if your JSON is an array rather than an object.
- Decide whether ISO date strings become TOML dates and whether whole numbers are written as floats.
- Read any notice listing the paths of null values that were changed.
- Copy the TOML or download config.toml; batch-convert files if needed.
Tips for better results
- Choose Stop with an error for nulls when generating configuration that must be complete, so a missing value is caught early.
- Turn off date conversion if a string like "2026-02-03" should stay text, for example a version label.
- Whole numbers as floats helps when a tool expects a float such as timeout = 30.0 and rejects integers.
- Check the result with TOML to JSON to confirm the round trip.
Common use cases
- Generating Cargo.toml or pyproject.toml sections from a script.
- Moving configuration from a JSON-based tool to one that reads TOML.
- Producing Hugo or Netlify configuration from JSON templates.
- Learning how JSON structures map to TOML tables.
Common mistakes to avoid
- Expecting null to survive the conversion; TOML has no null, so decide deliberately how it is represented.
- Converting arrays that mix objects with plain values; TOML cannot write those as arrays of tables, so they become inline values.
- Relying on numbers above 2^53 from JSON; they are already rounded by the JSON parser in the browser before conversion.
Frequently asked questions
Why are null values removed?
TOML deliberately has no null type; a missing value is expressed by leaving the key out. You can instead write an empty string, or have the converter stop and show where the null is.
What happens to a JSON array at the top level?
A TOML document must be a table, so the array is placed under a key, items by default. An array of objects then becomes a series of [[items]] tables.
How are dates written?
With date conversion on, "2026-02-03" becomes the local date 2026-02-03 and "2026-01-15T08:30:00Z" becomes an offset date-time, both unquoted. Other strings stay quoted.
Is the output valid TOML 1.0?
Yes. Keys that need quoting are quoted, strings are escaped and tables are ordered so that plain values come before sub-tables, as the specification requires.
Feedback & suggestions
Help us improve JSON to TOML Converter. We read every message.