Skip to content
gohacks.dev
Tooling

TOML to JSON Converter

Convert TOML files such as Cargo.toml and pyproject.toml to JSON, and JSON back to TOML, with tables, arrays of tables and inline tables.

Free · No sign-up · Your inputs stay in your browser

Input

Convert TOML to JSON and back

Output

Result

361 characters

Covers TOML 1.0 tables, arrays of tables, inline tables, dotted keys, every string form and hex, octal and binary integers. Dates are kept as their text. JSON null has no TOML equivalent, so null keys are dropped.

Runs in this browser. Nothing you paste is sent to a server.

Where TOML is used

Rust's Cargo.toml, Python's pyproject.toml, Hugo and Netlify configuration and many CLI tools use TOML 1.0, because it maps directly to a hash table and is hard to get wrong. Unlike YAML, indentation means nothing and every string is quoted.

What does not survive

Comments are lost converting to JSON. JSON's null has no TOML equivalent, so null keys are dropped converting back, and TOML dates become strings in JSON because JSON has no date type.

Share

Frequently asked questions

What is [[double brackets]] in TOML?
An array of tables: each [[bin]] header adds another object to the bin array, as in Cargo.toml's list of binaries.
Can a key be defined twice?
No. TOML forbids defining the same key or table twice, and the converter reports it as an error.
Is what I paste sent anywhere?
No. The tool runs entirely in your browser with JavaScript. Nothing you type or paste is sent to our server or stored.

Keep planning

Similar tools