TOML to JSON Converter
Convert TOML configuration to JSON format
About This Tool
TOML (Tom's Obvious Minimal Language) is a configuration format with explicit sectioning, native datetimes, and unambiguous string types. JSON is the lingua franca of web APIs and tooling. The two map cleanly: TOML tables become JSON objects, arrays become arrays, datetimes become ISO 8601 strings.
The converter parses TOML 1.0.0 spec including arrays of tables, inline tables, and multi-line strings, emitting valid JSON.
TOML was created by Tom Preston-Werner (GitHub co-founder) in 2013 as a reaction to YAML's complexity and JSON's lack of comments. The 1.0.0 specification was finalized in 2021 after years of iteration. TOML's distinguishing features: native datetime types (date, time, datetime with offset, datetime local), table syntax with explicit `[section.subsection]` headers, arrays of tables via `[[items]]`, multi-line strings with both literal (single-quoted) and basic (double-quoted) variants, and integer/float distinction (1 is an integer, 1.0 a float). JSON has none of these — types are object, array, string, number, boolean, null, with no datetime, no comments, and no string-type variants.
A worked example: TOML input ``` title = "Site Config" [server] host = "localhost" port = 8080 [[users]] name = "alice" role = "admin" [[users]] name = "bob" role = "reader" ``` becomes JSON ``` { "title": "Site Config", "server": { "host": "localhost", "port": 8080 }, "users": [ { "name": "alice", "role": "admin" }, { "name": "bob", "role": "reader" } ] } ``` Double-bracket arrays of tables collapse into JSON arrays of objects. The integer 8080 and the strings preserve their types. A datetime field like `created = 2024-01-15T10:30:00Z` becomes `"created": "2024-01-15T10:30:00Z"` — JSON has no datetime so the value serializes as RFC 3339 / ISO 8601 string.
Limitations: round-tripping TOML through JSON loses information. Comments in TOML disappear (JSON has no comment syntax). The integer/float distinction collapses for values like `1.0` if the JSON parser normalizes — most preserve it but the spec doesn't require it. The converter handles TOML 1.0.0; older 0.x specifications had different handling for nested tables and may not parse. Multi-line basic strings preserve escape sequences in JSON output, which is correct but visually different from the source. For the reverse direction (JSON → TOML), arrays of mixed-type values and arbitrary key names sometimes don't have valid TOML representations.
The about text and FAQ on this page were drafted with AI assistance and reviewed by a member of the Coherence Daddy team before publishing. See our Content Policy for editorial standards.