JSON to TOML

What is a Json To Toml?

TOML is a configuration format designed to be easy for humans to read and edit, with a strict specification and real data types. It is used by Rust's Cargo.toml, Python's pyproject.toml, Hugo, Netlify and many tools. This converter turns JSON into equivalent TOML, which is handy when moving settings from JSON-based tools or generating config files.

How to use it

  1. Paste a JSON object.
  2. Copy the generated TOML.

Example

Input (double quotes in real JSON):

{
  'title': 'My site',
  'server': { 'host': 'localhost', 'port': 8080 },
  'users': [ { 'name': 'asha' }, { 'name': 'ben' } ]
}

Output:

title = "My site"

[server]
host = "localhost"
port = 8080

[[users]]
name = "asha"

[[users]]
name = "ben"

Mapping rules

  • Nested objects become tables with [name] headers.
  • Arrays of objects become arrays of tables with [[name]].
  • Arrays of simple values stay inline: tags = ["a", "b"].
  • Numbers, booleans and strings keep their types.

Limitations

  • No null in TOML. JSON null values cannot be represented and are usually omitted.
  • The root must be an object. A top-level JSON array has no TOML equivalent.
  • Keys with spaces or special characters are quoted.
  • TOML supports native dates like 2026-10-27T09:30:00Z; JSON strings that look like dates stay strings unless converted.

Frequently Asked Questions

How are nested JSON objects represented in TOML?

As tables, written with the key name in square brackets.

What does [[name]] mean in TOML?

It defines an element of an array of tables. Each [[name]] block adds one object to the array.

What happens to null values?

TOML has no null type, so null values are left out.

Can a JSON array be the root of a TOML file?

No. A TOML document is always a table, so the JSON root must be an object.