JSON to TOML Converter
Convert JSON into a valid TOML 1.0 config file, ready for Cargo.toml, pyproject.toml, Hugo or any app that reads TOML. Nested objects become [tables] and lists of objects become [[arrays of tables]]. Runs in your browser, so your data is never uploaded.
JSON Input
TOML
What Does This Converter Do?
It writes the same data as TOML (Tom's Obvious, Minimal Language), the config format used by Rust's Cargo, Python's pyproject.toml, Hugo, Netlify and many other tools. Simple values come first, nested objects become [sections], and the output follows TOML 1.0, so any TOML parser can read it.
How to Convert JSON to TOML
- Paste your JSON, drop a .json file on the box, or load it from a link with URL.
- Click Convert to TOML, or press Ctrl + Enter.
- Copy the TOML, or download it as a .toml file.
Example
{
"title": "Weather API",
"server": { "host": "0.0.0.0", "port": 8080 },
"jobs": [
{ "name": "refresh", "every": "15m" },
{ "name": "cleanup", "every": "24h" }
]
}title = "Weather API" [server] host = "0.0.0.0" port = 8080 [[jobs]] name = "refresh" every = "15m" [[jobs]] name = "cleanup" every = "24h"
How JSON Becomes TOML
| JSON | TOML |
|---|---|
| Nested object | A [table] section, e.g. [server] or [database.pool] |
| Array of objects | An array of tables, one [[jobs]] block per item |
| Array of values | An inline array: replicas = [ "db1", "db2" ] |
| String, number, boolean | The same value; text is quoted and escaped |
| Keys with spaces or other symbols | Quoted keys: "first name" = "Emily" |
null | Left out, because TOML has no null (the message says how many) |
| A top-level array | Placed under a key (default items), because a TOML file must start with a table |
TOML writes simple values before sections, so keys can come out in a different order than in your JSON. The data is the same: converting the TOML back with TOML to JSON gives equal values.
Tips
- Dates: JSON has no date type, so date strings stay quoted strings in TOML. Edit them to bare dates like
2026-11-24if your app expects a TOML date. - Comments: JSON has no comments, so there are none to carry over. You can add
# notesto the TOML afterwards. - Broken JSON? Common mistakes like trailing commas and single quotes are repaired automatically. For anything else, use JSON Repair.
- Prefer YAML for your config? Use JSON to YAML.
Frequently Asked Questions
How do I convert JSON to TOML?
Paste a JSON object and click Convert to TOML. Nested objects become [tables], arrays of objects become [[arrays of tables]], and you can copy the result or download a .toml file.
What happens to null values?
TOML has no null, so keys with a null value are left out. The message under the tool tells you how many were removed.
Can I convert a JSON array to TOML?
Yes. A TOML file must start with a table, so a top-level array is placed under a key, items by default, which you can change.
Is my JSON uploaded?
No. The conversion runs in your browser and your data never leaves your device.