TOML ↔ JSON Converter
Convert between TOML and JSON instantly in your browser
No data is sent to any server — everything runs client-side
TOML Input
Paste your TOML here
JSON Output
Converted result
What Is TOML?
TOML (Tom's Obvious, Minimal Language) is a configuration file format designed to be easy to read and write. Created by Tom Preston-Werner (co-founder of GitHub), TOML maps unambiguously to a hash table and is intentionally simpler than YAML while being more readable than JSON for configuration files.
TOML has become the standard configuration format for Rust (Cargo.toml), Python (pyproject.toml as defined in PEP 518/621), Hugo static sites, and many other tools. Its strict specification means there are no surprises from implicit type coercion — unlike YAML, NO is always a string, never a boolean.
TOML vs YAML vs JSON
| Feature | TOML | YAML | JSON |
|---|---|---|---|
| Comments | ✓ | ✓ | ✗ |
| Date/time types | ✓ native | Via tags | ✗ (string only) |
| Deeply nested | Verbose (tables) | Natural | Natural |
| Type ambiguity | None | High | None |
| Best for | Config files | Infrastructure | Data exchange |
Common TOML Use Cases
Rust & Cargo
Cargo.toml defines Rust crate metadata, dependencies, features, and build scripts. Convert to JSON for programmatic analysis.
Python pyproject.toml
PEP 621 standardized project metadata in pyproject.toml. Used by pip, Poetry, Hatch, and PDM for Python package configuration.
Hugo & Static Sites
Hugo supports TOML (default), YAML, and JSON for site configuration and front matter.
Deno & Bun configs
Various modern JavaScript runtimes and tools are adopting TOML for configuration as a JSON alternative.
Related Tools
How to Use the TOML ↔ JSON Converter
Choose a conversion direction
Select "TOML → JSON" to parse a TOML config file and convert it to JSON, or "JSON → TOML" to convert a JSON object into TOML format.
Paste your input
Paste your TOML (e.g. Cargo.toml or pyproject.toml contents) or JSON into the left panel.
Click Convert
Click the Convert button. For TOML→JSON the output is formatted JSON with 2-space indentation. For JSON→TOML the output follows TOML section syntax.
Copy and use
Copy the result and use it in your project. Both directions are lossless for data types that map between the formats — note that TOML's native date/time types become strings in JSON.
Frequently Asked Questions
Why would I convert TOML to JSON?▼
JSON is universally supported by all languages and tools. Converting Cargo.toml or pyproject.toml to JSON lets you process config data with JSON tools, APIs, or scripts that don't have TOML parsers.
Can TOML represent everything JSON can?▼
Nearly. TOML can represent all JSON data types plus native date and datetime types. However, JSON arrays of mixed types are not valid in TOML — TOML arrays must be homogeneous (all elements the same type).
Why is TOML stricter than YAML about types?▼
TOML was designed to eliminate YAML's notorious type coercion ambiguities. In YAML, "NO", "off", "false", and "0" can all be parsed as boolean false depending on the parser. TOML requires explicit type declarations, so "NO" is always a string.
What happens to TOML comments when converting to JSON?▼
JSON does not support comments, so they are lost during TOML→JSON conversion. If you convert back to TOML, the comments will not be present in the output.
What are TOML tables?▼
Tables in TOML are the equivalent of JSON objects. A [section] header creates a table, and [[array-of-tables]] creates an array of objects. These map directly to nested JSON objects and arrays.
Further Reading
Built by JDApplications