TOML to JSON — TOML 1.0 Parser with Error Locations and a Typed Mode
Parse [table] TOML configuration files into clean structured JSON.
- Datetimes, local dates and local times become RFC 3339 strings; hex, octal and binary integers are written as decimals without losing digits.
When to use the TOML v1.0 to Formatted JSON Converter
Complete table rules
A table defined twice, a dotted key that reopens another table, or an inline table extended later is rejected with its line and column, just as Python's tomllib does.
Tested with toml-test
The parser passes the 553 TOML 1.0 cases of toml-test: 182 valid documents match the expected typed values, and 371 broken documents are rejected at the same position as tomllib.
Dates and numbers intact
Datetimes, local dates and local times are written as RFC 3339 text. Hex, octal and binary integers become decimals without losing digits.
Typed mode
The typed mode writes each value as a {"type", "value"} object like the toml-test format, so datetimes, floats and integers stay distinguishable in JSON.
Frequently asked questions
Why is my inline table rejected?
In TOML 1.0 an inline table must fit on one line without a trailing comma. Write long tables as [tables].
How does a datetime differ from a local date?
A datetime with an offset such as 2026-11-23T08:30:00+07:00 points at one exact moment. Local datetimes, dates and times carry no time zone, so the typed mode marks them as datetime-local, date-local and time-local.
Is the key order kept?
Yes. Keys are written in the order they appear in the TOML file.
Are TOML 1.1 features supported?
Not yet. The parser follows TOML 1.0.0, so the \e and \xHH escapes and multi-line inline tables of TOML 1.1 are rejected.
Is my file uploaded?
No. Parsing runs in your browser.
Similar tools
- JSON to TOML (Cargo.toml / pyproject.toml) ConverterSerialize JSON key-values and nested tables into valid TOML v1.0 syntax.
- JSON Formatter & Syntax PrettifierFormat messy single-line JSON with 2/4-space indentation and sorted keys.
- JSON Minifier & Whitespace CompressorStrip whitespace and newlines from JSON payloads and compare byte savings.
- RFC 8259 JSON Syntax Validator & DebuggerPinpoint trailing commas, unquoted keys & syntax errors with line/column clues.