TOML to JSON Converter
Convert Cargo.toml, pyproject.toml, Hugo or any TOML file to JSON with a complete TOML 1.0.0 parser — tables, arrays of tables, inline tables, dotted keys and dates all handled, with the exact line of any error.
TOML to JSON Converter
Runs in your browser — nothing you enter is uploaded or stored.
Scratchpad auto-saved
How it works — in four simple steps
No signup and nothing to install — it all runs in your browser.
Add your TOML
Paste it into the left box, press Open file, or drag a .toml file onto it. Sample loads a realistic example.
Set the options
Adjust the options above the boxes — the output updates instantly as you change them.
Check the result
Read the status line: it reports rows, keys and any value that couldn't be represented in JSON.
Copy or download
Copy the JSON or download it as a .json file. Nothing was uploaded at any point.
It's a strict TOML 1.0 parser, so it doubles as a validator: errors show the exact line.
Features
Pretty or minified
2 or 4 spaces, tabs, or a minified single line for the smallest possible file.
Private by design
Parsing and conversion run in your browser with JavaScript — your data is never uploaded, logged or stored.
About the TOML to JSON Converter
TOML (Tom's Obvious Minimal Language) reached version 1.0.0 in January 2021 and is now the configuration format of Rust's Cargo, Python packaging (pyproject.toml), Hugo, Netlify, uv, Ruff and many more. It maps directly onto a JSON object: every TOML document is a table, which is a JSON object; arrays are arrays; strings, integers, floats and booleans map to their JSON equivalents.
The parser here implements the whole 1.0 grammar: [table] and [a.b.c] headers, [[array.of.tables]], inline tables { x = 1 }, dotted keys site.name = "…", all four string forms (basic, literal, and their multi-line versions with line-ending backslashes), hex/octal/binary integers, underscores in numbers, inf and nan, and the four date-time types. It also enforces TOML's rules — redefining a key or a table is an error — and reports the line number, so it doubles as a TOML validator.
JSON has no date type, so TOML offset date-times, local date-times, dates and times are written as their ISO 8601 strings, exactly as they appeared. Integers beyond JavaScript's safe range (±9,007,199,254,740,991) are kept as strings so they aren't rounded.
Examples
A typical Python pyproject.toml with dotted tables, an array of tables and a dependency list.
[project]
name = "feather-cli"
version = "2.3.0"
requires-python = ">=3.10"
dependencies = ["httpx>=0.27", "rich"]
[project.scripts]
feather = "feather.cli:main"
[tool.ruff]
line-length = 100
[[tool.uv.index]]
name = "pytorch"
url = "https://download.pytorch.org/whl/cpu"{
"project": {
"name": "feather-cli",
"version": "2.3.0",
"requires-python": ">=3.10",
"dependencies": [
"httpx>=0.27",
"rich"
],
"scripts": {
"feather": "feather.cli:main"
}
},
"tool": {
"ruff": {
"line-length": 100
},
"uv": {
"index": [
{
"name": "pytorch",
"url": "https://download.pytorch.org/whl/cpu"
}
]
}
}
}This output was produced by the converter on this page with the default options — load it with the “pyproject.toml” preset above and change any option to see the effect.
How TOML maps to JSON
| In TOML | Becomes in JSON |
|---|---|
title = "Feather" | "title": "Feather" |
[server] table | "server": { … } |
[[workers]] ×2 | "workers": [ {…}, {…} ] |
Dotted key db.pool = 10 | "db": {"pool": 10} |
started = 2026-10-21T09:30:00Z | "started": "2026-10-21T09:30:00Z" |
mask = 0o755, big = 1_000_000 | 493, 1000000 |
ratio = inf | null (JSON has no infinity) |
# comment | dropped |
Things that trip people up
- Tables defined twice. TOML forbids declaring
[server]twice or setting a key twice; the parser stops with the line number. Merge the two sections. - Dates become strings. JSON has no date type, so dates come out as ISO strings. Parse them in your code (e.g.
new Date(s)) if you need date objects. - inf and nan. TOML allows them; JSON doesn't, so they're written as null. Check any float fields that might hold them.
- Inline tables are closed. In TOML 1.0 an inline table must fit on one line and can't be extended later — a common error when hand-editing pyproject.toml.
TOML vs JSON at a glance
| Property | TOML | JSON |
|---|---|---|
| Specification | TOML 1.0.0 (2021) | RFC 8259 (2017) · ECMA-404 |
| File extension | .toml | .json |
| Media type | application/toml | application/json |
| Data types | string, integer (64-bit), float, boolean, date-time, array, table | string, number, boolean, null, object, array |
| Comments | Yes # | No |
| Nesting | Tables and dotted keys | Unlimited |
- TOML: There is no null in TOML, and the document root must be a table (key/value map), not an array.
- JSON: Numbers are parsed as IEEE-754 doubles in JavaScript, so integers above 9,007,199,254,740,991 (2⁵³ − 1) lose precision.