JSON to TOML
Convert JSON to TOML, the readable config format used by Cargo (Rust), pyproject.toml, Hugo, etc. Supports strings, numbers, booleans, arrays and nested tables. Everything in your browser.
Moving configuration from JSON to TOML
You have a block of configuration in JSON and the target wants TOML: pyproject.toml, Cargo.toml, a Hugo config, a netlify.toml. Rewriting it by hand is annoying because TOML flips the nesting model, turning every inner object into a bracketed table header. Paste the JSON on the left and the TOML appears on the right as you type.
Here is the rule the converter applies that people forget when writing TOML by hand: within each level, plain key equals value pairs come first and tables come after. That ordering is required, because in TOML everything following a header belongs to that table, so a loose key at the end of the file would land in the wrong one. That is why the key order in the output can differ from your JSON. Keys with dots, spaces or accents come out quoted.
Three limits are worth knowing before you paste the result. The root has to be an object: an array or a bare value returns an error, since TOML has no such concept at the root. null becomes an empty string, because TOML has no null. And an array of objects is emitted as an array of JSON strings, not as a double-bracket array of tables, so that part needs a manual pass. Dates stay strings. The whole conversion happens in your browser.
Frequently asked questions
Why do I get an error saying the root must be an object?
What happens to null values?
Does it convert TOML back to JSON?
Related Tools
TOML to JSON
Convert TOML to JSON. Supports strings, integers, floats, booleans, dates, arrays and nested tables. Useful to inspect configs or pipe them into scripts. Everything in your browser.
JSON ⇄ Query String Converter
Convert a flat JSON object to a query string (?a=1&b=2) and vice versa. Supports a[]=1&a[]=2 array style. Everything in your browser.
JSON to Java Class
Convert JSON to a Java POJO class with getters/setters and inferred types. Supports nested classes and arrays as List. Everything in your browser.
JSON to YAML
Convert JSON data to YAML format.
JSON Lines → CSV
Convert JSONL (NDJSON) file to CSV, deriving headers from the union of all observed object keys.
YAML to TOML Converter
Convert config files from YAML to TOML right in your browser, preserving strings, numbers and booleans. Handy for migrating configs between formats.