TOML to JSON
Convert TOML to JSON with ISO strings for date values, configurable indentation, key sorting, and clear line/column errors plus key and depth statistics.
Runs in your browserEvery computation happens in your browser — your data never leaves this device.
- No keys were parsed, so the result is an empty object.
What this tool does
- Turn Cargo.toml, pyproject.toml or Netlify / Hugo config into JSON for tools and APIs that only speak JSON.
- Inspect the table structure at a glance: nesting is preserved, [server] becomes a nested object and [[users]] becomes an array of objects.
- Find TOML syntax errors fast: a failed parse reports the exact line, column and the offending code snippet instead of a vague message.
- Check how types are translated: date-time values become ISO strings, and inf / nan — which JSON cannot represent — become strings with a warning.
Example
Input
title = "UniKit" version = "0.1.0" release_date = 2026-10-10 [owner] name = "Tom" roles = ["admin", "dev"]
Output
{
"title": "UniKit",
"version": "0.1.0",
"release_date": "2026-10-10",
"owner": {
"name": "Tom",
"roles": [
"admin",
"dev"
]
}
}Indentation defaults to 2 spaces. TOML date-time values become ISO strings, which is why release_date appears as the quoted string "2026-10-10".
Frequently asked questions
Why did my TOML date turn into a string?
JSON has no date type. Date-time values are converted to ISO 8601 strings (the .000 milliseconds are dropped when they are all zero), which new Date() parses directly. Convert to a numeric timestamp yourself if that is what you need.
What happens with empty input?
You get an empty object {} plus a note that no keys were parsed — that is not treated as an error. Only genuine syntax problems raise an error with a line and column.
Can it tell me which line failed to parse?
Yes. The error carries the line, the column and a code snippet with a caret marker, shown as “line X, column Y” on the page.
How are inf and nan handled?
JSON cannot represent them, so they become the strings "inf", "-inf" and "nan", and the affected key paths are listed in the result instead of being silently dropped.
Is my config uploaded anywhere?
No. The parser ships with the page and runs entirely in your browser; no network request is made and it works offline.
Keywords:tomljsontoml 转 jsonconverter配置转换smol-tomlcargo.tomlpyproject.toml