Paste any TOML document and get formatted JSON output instantly. Tables become objects, arrays of tables become JSON arrays, and all scalar types map correctly.
TOML's structure maps directly to JSON objects. Every TOML document is a root table, which becomes a JSON object. Nested tables and inline tables become nested objects; arrays of tables become JSON arrays of objects.
Input TOML:
[server]
host = "localhost"
port = 8080
debug = true
features = ["auth", "logging"]
timeout = 30.5
[[users]]
name = "Alice"
role = "admin"
[[users]]
name = "Bob"
role = "viewer"
Output JSON:
{
"server": {
"host": "localhost",
"port": 8080,
"debug": true
},
"features": ["auth", "logging"],
"timeout": 30.5,
"users": [
{ "name": "Alice", "role": "admin" },
{ "name": "Bob", "role": "viewer" }
]
}
Key mappings:
{ key = "val" } → JSON objectsTOML has a richer type system than JSON, and most of it converts without surprises.
Integers and floats both become JSON numbers. TOML draws a hard line between them (42 vs 42.0), but JSON treats all numbers the same — the trailing .0 is dropped in the output. Booleans convert identically. Strings convert directly regardless of which TOML variant you used: basic strings, literal strings (single-quoted), and multi-line triple-quoted strings all become plain JSON strings.
Dates are where the conversion gets lossy. TOML has a native datetime type; JSON does not. The converter outputs them as ISO 8601 strings ("1979-05-27T07:32:00.000Z"), which is the right call for interoperability, but the type information is gone — downstream code will see a string, not a date object.
Comments are stripped entirely. JSON has no comment syntax, so # ... annotations have nowhere to go. If you need to preserve comments, keep the original TOML file alongside the converted output.
Converting TOML to JSON is useful when a tool or API accepts JSON but your config is in TOML.
Rust's Cargo.toml and Python's pyproject.toml are the most common inputs. If you need to inspect or process package metadata in a JSON-native tool — a script, a database insert, a REST call — converting first is faster than writing a TOML parser.
Hugo site configuration in TOML sometimes needs to be audited or diffed. Converting to JSON lets you use the JSON Diff tool or run JSONPath queries against the config.
CI pipelines that accept JSON config can consume converted TOML directly. The output of this tool is valid, pretty-printed JSON ready for any downstream use.
TOML datetime values (e.g. 1979-05-27T07:32:00Z) are converted to ISO 8601 strings in the JSON output. JSON has no native date type, so strings are the correct representation.
Comments are stripped. JSON has no comment syntax, so there is nowhere to put them. If you need to preserve comments, keep the original TOML file.
Each [[section]] block becomes one element in a JSON array. Multiple [[users]] blocks become an array of user objects under the "users" key.
Yes. Paste the file contents directly. The converter handles all standard TOML features used in those files, including inline tables, arrays of tables, and dotted keys.
TOML is designed for configuration files humans write and maintain — it supports comments, has more readable syntax for nested config, and has explicit types for dates and integers. JSON is designed for data interchange between programs. TOML is common in Rust, Python packaging, and Hugo; JSON is standard for APIs and databases.
No. Conversion runs entirely in your browser using the @iarna/toml library. Nothing leaves your machine.
More Tools