How to use the TOML to JSON Converter
Convert TOML to JSON in seconds:
1
Paste your TOML
Paste any valid TOML content — Cargo.toml, pyproject.toml, Hugo config, or any other TOML file.
2
Click Convert
Get a clean, formatted JSON object. TOML tables become JSON objects; arrays of tables become JSON arrays.
3
Copy or download
Copy the JSON output to clipboard or download as a .json file.
When to use this tool
Use TOML to JSON Converter when you need to:
- →Convert Cargo.toml to JSON for analysis or processing in JSON-based tooling
- →Process pyproject.toml or setup.cfg TOML sections as JSON in build scripts
- →Convert a Hugo site configuration (config.toml) to JSON for custom tooling or migration
- →Transform any TOML config file into JSON for environments or APIs that only accept JSON
- →Inspect TOML structure by viewing it as JSON during debugging or code review
Frequently asked questions
Q:What TOML features are supported?
All TOML v1.0 features: standard tables ([table]), arrays of tables ([[table]]), inline tables, dotted keys (a.b.c), all scalar types (string, integer, float, boolean), datetime values (converted to ISO 8601 strings), multi-line basic and literal strings, and hexadecimal/octal/binary integer literals.
Q:How are TOML datetimes converted to JSON?
TOML has a native datetime type; JSON does not. TOML datetime values are converted to ISO 8601 format strings in the JSON output — for example, 1979-05-27T07:32:00Z stays as the string '1979-05-27T07:32:00Z'. Local dates and times without timezone offsets are also preserved as ISO 8601 strings.
Q:How do TOML arrays of tables ([[table]]) convert to JSON?
TOML arrays of tables ([[bin]], [[dependency]], etc.) convert to JSON arrays of objects. For example, multiple [[bin]] sections in Cargo.toml become { bin: [ { name: 'server', path: '...' }, { name: 'worker', path: '...' } ] }.
Q:Can I convert Cargo.toml with workspace dependencies?
Yes. Cargo.toml is standard TOML and converts cleanly. [package], [dependencies], [dev-dependencies], [[bin]], [[example]], and [workspace] sections all convert correctly to their JSON equivalents.
Q:Can I convert pyproject.toml with this tool?
Yes. pyproject.toml is standard TOML. The [tool.poetry], [tool.pytest.ini_options], [build-system], and all other sections convert cleanly to nested JSON objects. Dotted section names like [tool.poetry.dependencies] become nested JSON: { tool: { poetry: { dependencies: { ... } } } }.
Q:Why does my TOML fail to parse?
Common TOML parse errors: defining a key twice at the same level (TOML forbids duplicate keys), mixing inline tables with standard table syntax for the same key, using a standard table ([a.b]) after an inline table that already defined that path, or an unterminated string. The error message shown by the converter includes the line number to help locate the issue.