Reading TOML as JSON
TOML files are easy for people to edit, but many tools, dashboards and scripts only understand JSON. Converting a Cargo.toml, pyproject.toml, netlify.toml or Hugo config to JSON lets you inspect it with JSON tools, validate it or load it without a TOML parser.
This converter uses smol-toml, a TOML 1.0 compliant parser. Tables become objects, array tables become arrays of objects and inline tables become nested objects. Invalid TOML produces an error message rather than partial output.
TOML vs JSON at a glance
| Feature | TOML | JSON |
|---|---|---|
| Full name | Tom's Obvious, Minimal Language | JavaScript Object Notation |
| Type | Configuration data | Hierarchical data |
| Introduced | 2013 | Early 2000s (RFC 4627 in 2006) |
| Created by | Tom Preston-Werner | Douglas Crockford; now ECMA-404 and RFC 8259 |
| Structure | Key/value pairs grouped into [tables] | Nested objects and arrays |
| Comments | Yes, with # | No |
| Data types | String, integer, float, boolean, date-time, array, table; no null | String, number, boolean, null, object, array |
| Best for | Project config such as Cargo.toml and pyproject.toml | APIs, web apps and app settings |
| Support | Rust, Python, Go and most languages via libraries | Every programming language |
| MIME type | application/toml | application/json |
How to convert TOML to JSON
Step 1: Select the .toml file
Drop your config file onto the converter.
Step 2: Keep JSON as the target
JSON is preselected. YAML and XML are also available.
Step 3: Convert
The TOML is parsed and written as indented JSON.
Step 4: Download
Save the .json file and use it anywhere.
Type mapping
Tables to objects
[package] becomes a package object.
Array tables to arrays
[[bin]] entries become an array of objects.
Dates to strings
TOML dates and times become ISO 8601 strings.
Numbers kept
Integers and floats become JSON numbers.
Why convert TOML to JSON
Inspecting project metadata. Read package names, versions and dependencies in JSON tools.
CI scripts. Parse config values in environments that ship only a JSON parser.
Validation. Check configs against a JSON Schema.
Migrating tools. Move settings to a JSON-based configuration system.
Precision and special values
JSON numbers are handled as double precision floats by most software, so integers larger than about nine quadrillion (2 to the 53rd power) cannot be represented exactly. Rather than silently changing such a value, the converter stops with an error; write very large numbers as quoted strings in the TOML if you need them.
TOML allows inf and nan as float values; JSON has no equivalent, and they are written as null. Comments are removed because JSON cannot hold them.
When conversion fails
TOML is strict. Defining the same key twice, redefining a table, or mixing a table with a dotted key of the same name is an error, and the converter reports it. The message usually includes the line where the problem was found.
Fixing the TOML in an editor with syntax highlighting is the quickest way to resolve these errors.
- Duplicate keys: not allowed.
- Unquoted strings: not allowed.
- Trailing commas in inline tables: not allowed.
Tips for TOML to JSON
- Quote every string value in TOML; bare words are errors.
- Keep dates unquoted in TOML if you want them treated as dates.
- Use JSON to TOML to convert edited data back.
- For large dependency lists, pipe the JSON into jq for quick queries.
TOML to JSON questions
Which TOML version is supported?
TOML 1.0, through the smol-toml parser.
How are dates converted?
Into ISO 8601 strings such as 2026-09-17T10:00:00.000Z.
Are comments kept?
No. JSON has no comment syntax.
What about array tables?
Each [[table]] block becomes an element in a JSON array.
Why do I get an error?
TOML is strict about duplicate keys and quoting. The error message explains what went wrong.
Is the file uploaded?
No. Everything runs in your browser.