What is the JSON to TOML Converter?
The JSON to TOML Converter turns a JSON document into a TOML 1.0.0 configuration file. You paste JSON on the left, and the tool emits TOML that re-parses to the same data: top-level JSON objects become the root table, nested objects become `[table]` headers, arrays of objects become `[[array-of-tables]]` blocks, and scalars, mixed arrays, and small objects are written inline. It is the fastest way to move a config out of an API response or a JSON settings file and into the TOML that tools like Cargo, Poetry, Hugo, and many Rust and Go projects expect.
TOML (Tom's Obvious, Minimal Language) reads like an INI file but has a precise specification: typed values, first-class dates, and two distinct ways to express nested data. That precision is exactly what trips people up when hand-editing. The rule that catches everyone is ordering, a table's own keys must appear before any of its sub-table headers, or the file fails to parse. This converter applies that rule automatically, so you never end up with a key stranded under the wrong header.
Everything runs in your browser as plain JavaScript. The JSON you paste is never uploaded, there is no account to create, and the converter keeps working with no network connection once the page has loaded. That matters when the JSON is a production config or contains secrets you would rather not send to a third-party server. The output is standard TOML you can copy straight into `Cargo.toml`, `pyproject.toml`, `config.toml`, or any other TOML file.
A few conversions have no single right answer, and the tool makes its choices explicit. JSON `null` has no TOML equivalent, so null keys are dropped by default (with a note) or written as an empty string if you prefer. A JSON number like `5.0` arrives as the integer `5` because JSON does not preserve the trailing zero. And an array of objects can be written either as idiomatic arrays of tables or as inline tables, which you toggle depending on how the target tool likes to read its config.
How to use the JSON to TOML Converter?
Paste your JSON
Paste or type a JSON object into the input box, or click Load Sample to see a worked example. The top level must be a JSON object, since a TOML document is always a table.
Choose how arrays and nulls are handled
Toggle whether arrays of objects become arrays of tables ([[table]]) or inline tables, and whether JSON null keys are dropped or written as empty strings.
Convert
Click Convert. The tool validates the JSON, serialises it to TOML 1.0, and reports the number of tables written plus any notes about dropped nulls.
Copy the TOML
Copy the result and paste it into your Cargo.toml, pyproject.toml, or config.toml. The output is standard TOML that re-parses to the same data.
Key Features
Correct Table Ordering
Keys are emitted before sub-table headers automatically, so the output obeys the TOML rule that would otherwise make a hand-written file fail to parse
Arrays of Tables
Arrays whose elements are all objects become idiomatic [[table]] blocks, the TOML pattern for lists of records, or inline tables when you prefer them
Proper Value Typing
Integers, floats, booleans, and strings are rendered with TOML types, including inf and nan for non-finite numbers and full escaping of control characters in strings
Explicit Null Handling
JSON null has no TOML equivalent, so you choose whether null keys are dropped with a note or written as empty strings, no silent data loss
Frequently Asked Questions
Related Tools
YAML to JSON Converter
Convert YAML to JSON instantly - anchors, aliases, merge keys, block scalars and multi-document streams supported
Sales Tax Calculator
Add sales tax to a price or back it out of a tax-inclusive total. Works for any rate, shows the net, tax, and gross amounts, and multiplies by quantity.
TikTok Video Downloader
Download TikTok videos without watermark. Save videos, music, and cover images from any TikTok link.
Time Zone Converter
Convert any date and time between IANA time zones with DST-accurate offsets, see the gap between two cities, and plan meetings across the world
Comments
0 comments
No comments yet. Be the first to share your thoughts!