JSON to TOML Converter
Convert JSON to TOML. Handles nested objects (TOML tables), arrays of objects (TOML array-of-tables), and omits JSON null values (TOML has no null). Runs entirely in your browser.
Input
Output
Guides
Paste JSON, get TOML. This free online JSON to TOML converter turns any JSON object, array or API response into clean, spec-compliant TOML — the format Cargo.toml, pyproject.toml, .hugo.toml and most modern Rust, Python and Go tooling expect for configuration. Conversion happens as you type, with no upload and no sign-up.
How to use it
- Paste your JSON into the input box, or upload a
.jsonfile with the uploader — its contents drop straight into the editor. - The TOML output appears instantly on the right, syntax-highlighted.
- Copy it, or download it as a
.tomlfile ready to commit.
Nested JSON objects become TOML [tables] (a dotted path for objects nested several levels deep), and a JSON array whose entries are all objects becomes a TOML [[array-of-tables]] block — the syntax TOML uses for repeated table-shaped records, like a list of dependencies or servers. Plain arrays of strings, numbers or booleans stay inline arrays.
What happens to null values?
TOML has no way to represent null — there's no bare-null literal in the spec. This converter omits null values rather than erroring out: a null-valued object property is dropped ({"a":1,"b":null} becomes just a = 1), and a null inside an array is filtered out the same way (["a",null,"b"] becomes ["a","b"]). This mirrors how TOML-consuming tools generally treat "missing key" and "null" as the same thing — an absent value — so the conversion stays lossless for everything TOML can express, and simply drops what it can't.
Does it handle arrays and nested objects correctly?
Yes. A JSON array of objects — the classic "list of records" shape (dependencies, users, servers) — is emitted as TOML's [[array-of-tables]] syntax, not as a JSON-style inline array of inline tables. Objects nested inside objects become their own [section] or [parent.child] table. Because TOML documents must be a table at the root, a JSON array or a bare scalar (string/number/boolean) at the top level gets wrapped in a single items or value key so it still has somewhere to live.
Does it support TOML dates?
JSON has no native date type, so an ISO-8601-looking string in your JSON (e.g. "2024-01-01T00:00:00Z") is written out as a quoted TOML string, not TOML's native offset/local date-time type. If you need a typed TOML date, add it by hand after converting — round-tripping an untyped string is the only lossless choice available from JSON input.
Is my data private?
Completely. The conversion runs in your browser using smol-toml, a small, spec-compliant, pure-JavaScript TOML 1.0 library. Your JSON is never sent to a server, never logged and never stored — safe for config files containing hostnames, internal service names or other details you'd rather not upload anywhere.
Why convert JSON to TOML at all?
APIs and JavaScript tooling speak JSON natively, but a growing share of config files — Rust's Cargo, Python's pyproject.toml, Hugo, many CLI tools — standardized on TOML for its comment support and readability. This converter is the bridge: prototype or generate the data as JSON, then commit it in the format your toolchain actually expects.