JSON to TOML Converter

Drop a JSON object, get clean TOML — ready for Cargo, pyproject, or Hugo. Nested objects become tables, arrays of objects become arrays of tables, dates round-trip cleanly.

Drop your JSON file here

Converts to .toml — stays on your device

Why convert JSON to TOML?

How our converter works

Your JSON is parsed into a JavaScript object, then serialized as TOML by smol-toml. Top-level scalars become bare keys; nested objects become tables; arrays of objects become arrays of tables. ISO 8601 date strings are detected and emitted as TOML datetime literals. The top-level value must be a JSON object (TOML doesn't have a notion of a top-level array or scalar). Everything runs in your browser.

JSON vs TOML — when to use which

Feature JSON TOML
Comments No Yes (#)
Primary use APIs, data interchange Configs (Cargo, pyproject, Hugo)
Readability Dense, punctuation-heavy Indented sections, very scannable
Top-level shape Object, array, or scalar Object only
Date/time types ISO strings First-class datetime literals

Frequently asked questions

Why does it require a top-level object?

TOML's data model has no notion of a top-level array or bare scalar — every TOML document is a set of key-value pairs. If your JSON is an array (e.g. a list of records), wrap it in an object first: { "items": [...] } converts cleanly into a TOML array of tables.

Are nested objects supported?

Yes — they become TOML tables (sections like [server]). Deeply nested objects become dotted-section paths ([server.tls]). Arrays of objects become arrays of tables ([[users]] syntax).

What about ISO date strings?

They're written as TOML datetime literals in the output, which preserves them as first-class typed values. Round-tripping through toml-to-json brings them back as ISO strings.

Are my files uploaded?

No. The conversion runs entirely in your browser — JSON containing secrets, signing keys, or internal schemas stays on your device.

Will the output preserve key order?

Yes. JavaScript object key order is preserved through both the parse and the serialization, so the TOML output mirrors your JSON's structure.

About the JSON format

JSON is the lingua franca of APIs; TOML is the config format the Rust and modern Python toolchains chose because they wanted something more reviewable than YAML and less verbose than XML. Going JSON → TOML is what you do when something machine-generated (an API response, a script's output, a scaffolding tool) needs to land in a developer-readable config file. The mismatch points are well-defined: TOML has no top-level scalars or arrays, so the JSON has to be wrapped in an object first, and JSON has no comments to preserve. Otherwise the round-trip is faithful: TOML dates become ISO strings in JSON, JSON arrays of objects become TOML arrays of tables, and nesting depth is preserved.