TOML vs JSON
TOML (Tom's Obvious Minimal Language) is designed for configuration by humans: comments, dates, dotted keys, and no braces. JSON is designed for machine interchange: no comments, strict quoting, universal parser support. Converting between them is a daily chore when your Rust/Python project (TOML config) talks to a web API (JSON).
What this converter handles
- Tables
[section]and sub-tables[a.b.c]→ nested JSON objects. - Key-value pairs — strings, integers, floats, booleans, datetimes.
- Arrays and inline tables
key = { a = 1, b = 2 }. - Comments (
#) are stripped; keys are quoted properly. - JSON → TOML preserves nesting with standard
[table]headers.
Limits
Exotic TOML is only partially supported: array-of-tables [[items]] converts as arrays of objects, but multi-line strings and other advanced TOML syntax are not handled. Everything runs locally; nothing is uploaded.
When you'd use this
Porting a pyproject.toml into a CI pipeline that expects JSON env, converting Cargo.toml metadata for a dashboard, or generating a JSON config from a TOML template. Pair it with the JSONL Tools page for the full data-pipeline kit.
Formats, sizes and other limits
Parsing runs in stages: stripYamlComment()-style comment removal skips # inside quoted strings, the text is split only at top-level separators while tracking quote and bracket depth, keyPath() expands dotted keys and [table] headers into nested paths, and parseValue() decides between integers, floats, booleans, dates, strings and arrays. jsonToToml() reverses the mapping, and put() places each value at the right depth.
Where it stops working
A practical subset of TOML 1.0. Multi-line strings (triple-quoted and literal), inline-table edge cases and deeply nested arrays of tables may degrade. Dates have no native JSON type, so a round trip turns them into strings and loses the type. Integers beyond double precision lose accuracy, and keys containing dots must be quoted or they will be read as paths.
Privacy: nothing is uploaded
The configuration is parsed and re-serialised locally. Nothing is uploaded, though config files often contain secrets — do not paste production credentials into any online tool.
Frequently asked questions
Are dates preserved?
As strings only. JSON has no date type, so the value survives but the type does not.
Are multi-line strings supported?
Partially. Complex expressions with embedded newlines and escapes are best simplified before converting.
Can keys contain dots?
Yes, if quoted. Unquoted dots are read as path separators and will nest the key.