About the TOML to JSON
Convert TOML configuration files (Cargo.toml, pyproject.toml and others) into JSON.
Key features
- Full TOML 1.0 support
- Tables, inline tables and arrays of tables
- Dates and times converted to ISO strings
- Clear parse errors with line numbers
- Upload .toml files directly
- Pretty-printed JSON output
Convert TOML configuration to JSON
TOML is the configuration format behind Cargo.toml (Rust), pyproject.toml (Python packaging, Poetry, Ruff, Black), Hugo, Netlify, Deno, Starship and many other tools. Converting it to JSON is useful when you want to process a config with JSON tooling, inspect it in a tree view, feed it to an API or migrate to a system that expects JSON.
Example
[package]
name = "my-app"
version = "1.2.0"
authors = ["Ada <ada@example.com>"]
[dependencies]
serde = { version = "1.0", features = ["derive"] }
[[bin]]
name = "cli"
path = "src/main.rs"
{
"package": {
"name": "my-app",
"version": "1.2.0",
"authors": ["Ada <ada@example.com>"]
},
"dependencies": {
"serde": { "version": "1.0", "features": ["derive"] }
},
"bin": [
{ "name": "cli", "path": "src/main.rs" }
]
}
TOML to JSON mapping
| TOML | JSON |
|---|---|
key = "value" | "key": "value" |
[table] | Nested object |
[a.b.c] | Deeply nested object |
{ x = 1 } inline table | Object |
[[items]] | Array of objects |
1979-05-27T07:32:00Z | ISO date string |
# comment | Dropped |
Tips
- Errors with line numbers. If the TOML is invalid, the error points to the problem line. The TOML Validator is focused on that job.
- Duplicate keys are an error in TOML, even across
[table]sections.
Related tools
Convert in the other direction with JSON to TOML, or turn the JSON into YAML with JSON to YAML.
How to use the TOML to JSON
- Paste your data into the input box, upload a file, or click Sample to try it out.
- Adjust the options above the editor if you need to (indentation, delimiter, and so on).
- The JSON appears instantly in the output panel. Any errors are shown with their line and column.
- Click Copy to copy the result, or Download to save it as a file.