Skip to main content
File & Data Conversion Tools

JSON to TOML Converter

Convert JSON to TOML - objects become tables, arrays of objects become arrays of tables, with correct TOML value formatting.

Paste JSON below - this tool converts it into TOML syntax, with nested objects becoming tables and correctly-formatted values.

For the reverse direction, see the TOML to JSON Converter.

How the Conversion Works

Top-level primitive keys become plain key = value lines; nested objects become [table] sections; arrays containing only objects become [[array of tables]]; other arrays become inline TOML arrays.

How to Use It

  1. Paste a JSON object.
  2. Click Convert.
  3. Copy or download the resulting TOML.

Limitations

JSON's null has no direct TOML equivalent (TOML has no null type) - keys with a null value are omitted from the TOML output rather than producing invalid syntax, and this is noted so you're aware of the difference.

Example

{
  "name": "invoice-kit",
  "version": "1.4.0",
  "database": { "host": "db.internal", "port": 5432 },
  "servers": [ { "name": "alpha" }, { "name": "beta" } ]
}

becomes:

name = "invoice-kit"
version = "1.4.0"

[database]
host = "db.internal"
port = 5432

[[servers]]
name = "alpha"

[[servers]]
name = "beta"

Where TOML Is Used

  • Python: pyproject.toml for packaging and tool settings (Black, Ruff, pytest, Poetry).
  • Rust: Cargo.toml for every crate.
  • Static sites and apps: Hugo, Netlify (netlify.toml) and many CLI tools.

Tips

  • Keys with spaces or dots are quoted in TOML ("my key" = 1) - simple keys keep the file readable.
  • TOML has no null; leave the key out or use an empty string.
  • Comments are not part of JSON, so add them to the TOML file afterwards to explain important settings.

Convert back with TOML to JSON. Choosing a format? See JSON vs YAML vs TOML vs XML.

Frequently Asked Questions

Nested objects become [tables] and arrays of objects become [[arrays of tables]].

No. TOML has no null value, so null values must be removed or replaced before converting.

TOML requires plain key/value pairs to come before sub-tables within each table, so simple values are written first.
Share this tool: