TOML to JSON
Convert TOML config files to JSON — strings, numbers, booleans, arrays, tables
TOML Input
JSON Output
{
"package": {
"name": "my-app",
"version": "1.0.0",
"edition": "2021",
"description": "A sample TOML file"
},
"profile": {
"release": {
"opt-level": 3,
"debug": false,
"strip": true
}
},
"dependencies": {
"serde": "1.0",
"tokio": "1.28"
},
"features": {
"default": [
"serde"
],
"full": [
"serde",
"tokio"
]
}
}About the TOML to JSON Converter
This tool converts TOML to JSON, parsing table headers, arrays of tables, typed values and dates into a plain JSON object. Handy for reading a Cargo.toml or pyproject.toml from a script that only speaks JSON.
Convert TOML to JSON when tooling has to read a config file it does not natively understand — a build script inspecting Cargo.toml, CI reading pyproject.toml, or a dashboard pulling values out of netlify.toml. JSON is the format almost everything can parse.
The parser handles the whole structure rather than the flat case only: bracketed table headers become nested objects, double-bracket arrays of tables become arrays of objects, and TOML's typed values — integers, floats, booleans, dates and datetimes — are converted rather than left as strings.
It doubles as a TOML validator. If the file does not parse, the error tells you where, which is quicker than working out why a build is reading the wrong value.
How to use the TOML to JSON Converter
- Paste your TOML. Provide the contents of the .toml file.
- Convert. Run the parse to produce JSON.
- Fix any errors. If the TOML is invalid, the reported position points at the problem.
- Copy or download. Copy the JSON or save it as a .json file.
TOML to JSON Converter features
- Complex structure support
- Syntax validation
- Nested table handling
- Array preservation
- Error detection
- Real-time parsing
Frequently asked questions
How are TOML tables converted?
Bracketed table headers become nested JSON objects, and double-bracket arrays of tables become arrays of objects.
Are dates and datetimes handled?
Yes. TOML date and datetime values are parsed rather than being passed through as plain strings.
Can I use this to validate TOML?
Yes. Invalid TOML fails to parse and the error reports where the problem is.
Does it handle Cargo.toml and pyproject.toml?
Yes. Both are standard TOML and convert without special handling.
Is my config uploaded?
No. Parsing happens in your browser, so config files stay on your machine.