How to convert TOML to JSON
- Paste TOML or open a
.tomlfile. - Choose the JSON Indent: 2 spaces, 4 spaces or tabs.
- Press ⇄ to send the JSON to JSON to TOML.
Example: netlify.toml
[build]
command = "npm run build"
publish = "dist"
[[redirects]]
from = "/old-blog/*"
to = "/blog/:splat"
status = 301
[[redirects]]
from = "/api/*"
to = "/.netlify/functions/:splat"
status = 200
force = true
{
"build": {
"command": "npm run build",
"publish": "dist"
},
"redirects": [
{
"from": "/old-blog/*",
"to": "/blog/:splat",
"status": 301
},
{
"from": "/api/*",
"to": "/.netlify/functions/:splat",
"status": 200,
"force": true
}
]
}
[build] became an object and the two [[redirects]] blocks an array, in file order. Indentation inside tables means nothing in TOML.
Values with no JSON type
| TOML | JSON |
|---|---|
published = 2026-11-05T09:30:00+01:00 |
"2026-11-05T09:30:00.000+01:00" |
day = 2026-11-05 |
"2026-11-05" |
mode = 0o755 |
493 |
mask = 0xFF |
255 |
budget = 1_500_000 |
1500000 |
limit = inf |
null |
Dates and times become strings that keep their offset, with milliseconds added. Hex, octal and binary integers become decimal, and inf and nan become null. Comments are dropped, since JSON has no comments.
Errors and large integers
Syntax errors stop the conversion with the line and column: an unquoted name = Jane reports invalid value, and a key set twice reports trying to redefine an already defined table or value. Integers outside ±9,007,199,254,740,991 stop with integer value cannot be represented losslessly instead of being rounded.
To pull settings out of a large file, query the JSON in the JSONPath tester. For YAML configs, use YAML to JSON.