TOML ↔ JSON Converter

Convert TOML to JSON and JSON to TOML. Used for Rust, Hugo, Cargo, and config files.

Bidirectional Cargo.toml Hugo config Free
TOML input
JSON output

What is TOML?

Tom's Obvious Minimal Language

TOML is a config file format designed to be easy to read and write. It's the standard for Rust's Cargo.toml, Hugo static site configs, and many modern tools.

Key features

Native date/time types, inline tables, arrays of tables, multi-line strings, and comments — all things JSON doesn't support.

vs YAML and JSON

TOML is more explicit than YAML (no surprising type coercion) and more readable than JSON for config files. It's the config format of choice in the Rust ecosystem.

TOML — The Configuration Format Developers Are Switching To

TOML (Tom's Obvious Minimal Language) was created in 2013 by Tom Preston-Werner, co-founder of GitHub. His frustration with YAML's complexity and JSON's lack of comments led to TOML — a format that reads like an INI file but has a proper specification and supports complex nested data. It has since become the standard for Rust projects (Cargo.toml), Python packaging (pyproject.toml), and Hugo static sites.

What makes TOML different

TOML uses section headers in square brackets to define tables: [database] followed by key-value pairs defines a database configuration object. Arrays of tables use double brackets: [[servers]] defines an array where each [[servers]] block is one element. This is more explicit than YAML's indentation-based nesting and more readable than JSON's braces and quotes.

TOML native types

TOML has native support for types that JSON lacks. Dates: 2023-11-14. Datetimes with timezone: 2023-11-14T22:13:20Z. Local time: 22:13:20. Integers with underscores for readability: 1_000_000. Hexadecimal: 0xFF. These types are preserved during conversion — dates become ISO 8601 strings in the JSON output since JSON has no native date type.

When to use TOML vs YAML vs JSON

Choose TOML for configuration files in Rust, Python, or Hugo projects — it's the ecosystem standard. Choose YAML for Kubernetes, Docker, and GitHub Actions — it's required there. Choose JSON for APIs and data interchange — it's universally supported and fastest to parse. All three represent the same data structures; the choice is about ecosystem conventions and human readability.

Frequently asked questions

What is TOML used for?
TOML is most commonly used for: Rust project manifests (Cargo.toml), Hugo static site configuration, Python project metadata (pyproject.toml), and various application config files. It's designed specifically for configuration — not data interchange like JSON.
What are the differences between TOML and JSON?
TOML supports comments, has native date/time types, uses INI-style section headers ([section]), and has arrays of tables ([[array]]). JSON has none of these. TOML is more verbose but more readable for humans editing config files manually.
Can I convert Cargo.toml to JSON?
Yes. Paste your Cargo.toml into the input box and click Convert. The full structure including dependencies, dev-dependencies, and workspace settings will be converted to JSON.
What happens to TOML dates when converting to JSON?
TOML has native date/time types (e.g. 2023-11-14T22:13:20Z). Since JSON has no date type, they're converted to ISO 8601 strings in the JSON output.
Does JSON to TOML support all JSON types?
Most JSON types map cleanly to TOML. Strings, numbers, booleans, arrays, and objects all convert. Null values have no direct TOML equivalent — they're omitted or converted to empty strings depending on context.
Is my data safe?
Yes. All conversion runs locally in your browser. Nothing is uploaded anywhere.