JSON to TOML Converter

Paste JSON, get a TOML config

Input (JSON)

Output (TOML)

JSON to TOML Converter guide

TOML is easier to read and edit by hand than JSON, which is why tools like Cargo, Poetry, and Hugo use it. Paste a JSON object and get a TOML config back.

How it converts

  • Top level. TOML needs an object at the top, so a list or a single value cannot be converted.
  • Nested objects. Each one becomes a [table] section.
  • Lists of objects. These become [[arrays of tables]], one block per item.
  • Null values. TOML has no null, so give those keys a value or remove them first.

Example

{ "title": "my-app", "server": { "port": 8080 }, "owners": [{ "name": "Ann" }] }

// converts to

title = "my-app"
[[owners]]
name = "Ann"
[server]
port = 8080

Frequently asked questions

Why do I get "TOML needs an object at the top level"?
A TOML file is a set of keys, so the JSON must be an object. If your data is a list, put it under a key, such as { "items": [...] }.
Why do I get "TOML has no null values"?
TOML cannot store null. Replace it with a real value, such as an empty string, or remove the key.
Why are the sections in a different order?
Plain keys are written first and [table] sections after them, because in TOML every key after a table header belongs to that table.