JSON to TOML: Config for Rust, Python & Hugo
TOML is the configuration language of choice for Rust, Python packaging, and Hugo. If you have JSON configuration data and need to convert it to TOML for a Cargo.toml, pyproject.toml, or Hugo config, this tool handles the mapping automatically — nested objects become table sections, and arrays of objects use TOML's array-of-tables syntax.
Frequently Asked Questions
What is TOML?
TOML (Tom's Obvious Minimal Language) is a config file format designed to be minimal and readable. It is used by Rust's Cargo.toml, Python's pyproject.toml, Hugo's config.toml, and many other tools.
How are nested objects handled?
Nested JSON objects become TOML [table] sections. For example, `{"database":{"host":"localhost"}}` becomes `[database]` with `host = "localhost"` underneath.
How are arrays of objects handled?
Arrays of objects become TOML [[array tables]]. Each object in the array gets its own [[section]] block.
Does TOML support null?
No — TOML has no null type. This converter represents JSON null as the string "null". If you need nullability, TOML is not the right format.
What types does TOML support?
TOML natively supports strings, integers, floats, booleans, datetimes, arrays, and tables (objects). This converter handles strings, numbers, booleans, objects, and arrays.
Where is TOML commonly used?
TOML is the default config format for Rust (Cargo.toml), Python packaging (pyproject.toml), Hugo static site generator, and the Deno runtime.