How to use the JSON to TOML converter
- Paste a JSON object into the Input box. The sample is a Rust package manifest in JSON form.
- The TOML appears straight away; there are no options.
- Read any yellow note about dropped
nullvalues. - Copy the result or download it as
config.toml.
What it does and when to use it
TOML is the config format of Rust (Cargo.toml), modern Python packaging (pyproject.toml), Hugo, Netlify and many CLI tools. If your settings live in JSON, come from an API, or are produced by a script, this converter turns them into a file those tools can read without hand-copying every key.
It is also a handy way to learn TOML: paste JSON you already understand and see how the same structure looks in table syntax.
To check the result, run it back through TOML to JSON or the TOML formatter. If your JSON has comments or trailing commas, clean it first with JSONC to JSON.
How it works
- The input is parsed as strict JSON. Errors show a line and column, such as
Invalid JSON at line 1, column 8: unexpected “}”.for the trailing comma in{"a":1,}. - The top level must be an object; anything else stops with a message.
- Every
null, in objects and in arrays, is removed and its path is recorded. - The smol-toml library, loaded in your browser, writes the TOML: simple keys first, nested objects as
[parent.child]tables, arrays of objects as[[name]]blocks, and other arrays inline.
Worked examples
These are the tool’s own outputs.
The sample manifest. "package" becomes a [package] table with name, version and edition, and the nested serde dependency becomes [dependencies.serde].
Mixed values and a null. This JSON:
{"title":"App","owner":{"name":"Asha","email":null},"ports":[80,443],"ratio":2.0}
converts to:
title = "App"
ports = [ 80, 443 ]
ratio = 2
[owner]
name = "Asha"
with the note “TOML has no null, so these were left out: owner.email”.
An array of objects. {"servers":[{"name":"a","ip":"10.0.0.1"},{"name":"b","ip":"10.0.0.2"}]} gives two [[servers]] blocks, one per object.
A top-level array. [1,2] returns “TOML documents are tables, so the JSON must be an object at the top level.”
Limits and tips
- Key order can change. Plain values are written before tables, so a nested object listed first in your JSON appears lower in the TOML.
- Nulls inside arrays are removed too, which shortens the array.
- No comments are added. Write explanations into the TOML afterwards.
Frequently asked questions
Why are some of my keys missing?
Why can't I convert a JSON array?
Why did 2.0 become 2?
Do date strings become TOML dates?
Is my data uploaded?
How do we know nothing is uploaded? Test it yourself on the privacy proof page.