TOML ↔ JSON
Parse TOML into JSON or render a JSON object as TOML. Powered by @iarna/toml with full TOML 1.0 support including tables, arrays of tables, inline tables, and typed values. Pretty or compact JSON output.
Features
- Bidirectional TOML ↔ JSON
- Full TOML 1.0 support
- Pretty or compact JSON output
- Clear error messages for malformed input
Frequently Asked Questions
- Which TOML features are supported?
- Full TOML 1.0 — tables, arrays of tables ([[foo]]), inline tables, dotted keys, string/integer/float/boolean/datetime types, and multi-line basic and literal strings.
- Why does JSON → TOML sometimes fail?
- TOML's top level must be a table (an object). If your JSON root is an array or scalar, there's no valid way to express it as TOML — wrap it in an object like {"data": [...]} first.
- Are dates preserved?
- Yes. TOML datetimes round-trip as ISO 8601 strings through JSON, which is the standard JavaScript date representation.