- Tables become nested objects
- A [server] header becomes a "server" object, and [server.tls] nests a "tls" object inside it. Dotted keys behave the same way: a = { b = 1 } and a.b = 1 both produce {"a":{"b":1}}. The flat, header-based layout of TOML becomes a conventional JSON tree.
- Arrays of tables become arrays of objects
- Each [[products]] block becomes one element of a "products" array. Unlike XML, TOML is unambiguous here: a single [[products]] block still produces a one-element array, so the JSON shape does not change with the number of entries. Code consuming it can always iterate safely.
- Dates and times become ISO 8601 strings
- TOML has four date-ish types (offset date-time, local date-time, local date and local time), and JSON has none. Each is converted to an ISO 8601 string, which is the standard interchange form. This is the one lossy part of the conversion: a local date-time with no timezone is rendered in UTC, so the fact that it was deliberately zone-less is not preserved.
- Comments are dropped
- TOML # comments have no JSON equivalent and are discarded. Config files are usually well commented, so keep the TOML as your source of truth rather than treating the JSON as canonical.
- Numbers, and where precision matters
- TOML integers are specified as 64-bit signed, but JSON numbers are IEEE 754 doubles, so an integer above 2^53 loses precision on conversion. TOML also allows underscores for readability (1_000_000) and hex, octal and binary literals; all are converted to ordinary decimal JSON numbers. The special floats inf and nan have no JSON representation.