Guide
Converting between TOML, JSON and YAML
TOML is the configuration format of Rust (Cargo.toml), modern Python packaging (pyproject.toml), Hugo, Netlify and many command-line tools. It reads like an INI file but has real types: strings, integers, floats, booleans, dates, arrays and nested tables. Sometimes you need the same data as JSON for a script or as YAML for another tool, or you need to know why a TOML file will not load. This converter handles all three formats.
How the formats map
All three describe the same structures: maps of keys to values, lists and scalars. In TOML, a [server] header starts a table, which becomes a JSON object under the key server. Dotted keys such as pool.max = 10 and inline tables such as pool = { min = 2, max = 10 } are other ways of writing nested objects. A [[routes]] header starts one element of an array of tables, so two [[routes]] blocks become a JSON array with two objects.
Detecting the input
Paste any of the three and the format is detected: text that starts like a JSON object is read as JSON, text with [table] headers or key = value lines as TOML, and anything else as YAML. The input panel’s title shows what was detected, so you can tell if detection guessed wrong.
Dates and numbers
TOML has first-class dates and times. Converting to YAML keeps them as timestamps, and TOML output writes them back unquoted. JSON has no date type, so they become ISO 8601 strings such as 2026-10-29T09:00:00.000Z. Integers in TOML are 64-bit; JSON numbers in JavaScript are exact only up to 2⁵³, so very large integers may lose precision when converted to JSON.
What does not survive
Comments are not part of the data model of any of these parsers, so they are dropped. Formatting details such as alignment, blank lines and the choice between dotted keys and tables are normalised. Keep your original file under version control and reapply comments by hand if they matter.
Producing TOML
TOML documents must be a table at the top level. JSON or YAML that is an object converts directly; an array or a single value at the top level cannot be written as TOML, and the tool explains why. Nested objects become tables and arrays of objects become arrays of tables, which is the idiomatic TOML style.
Checking syntax
Converting is also a quick validator. If the TOML is invalid — a string without quotes, a table defined twice, a key assigned twice — the parser reports the first error with its position. Fix it and the output appears immediately.
A worked example
The sample configuration has a title, a release timestamp, a [server] table, a [database] table with an inline pool, and two [[routes]]. As JSON, server.port is 8080, database.pool.max is 10, routes is an array whose second entry allows GET and POST, and released becomes "2026-10-29T09:00:00.000Z". As YAML, server: is followed by host: 0.0.0.0 on an indented line.
Pyproject and Cargo tips
In pyproject.toml, dependencies are an array of strings under [project], while tool settings live in [tool.name] tables; converting to JSON is a handy way to see exactly which table a setting belongs to. In Cargo.toml, [dependencies] entries can be a version string or an inline table with features, and both forms convert cleanly.
Related tools
Switch YAML and JSON with YAML to JSON, tidy JSON in the JSON Formatter, move environment variables with the .env Converter, or model the configuration in Rust with JSON to Rust.
Checked against the current version of the TOML ⇄ JSON & YAML on .

