JSON to TOML
Convert a JSON object to TOML. Paste JSON on the left; the TOML output builds on the right as you type.
{ "package": { "name": "vayce", "version": "1.0" }, "dependencies": ["astro", "preact"] }
becomes
dependencies = [ "astro", "preact" ]
[package]
name = "vayce"
version = "1.0"
A nested object like package becomes a [package] table. A flat array of strings stays an inline array, since TOML supports arrays as values directly, it’s only the root of the whole document that can’t be an array.
The root must be an object
TOML documents are key-value pairs from the first line, so there’s no way to represent a JSON value that’s just [1, 2, 3] or "hello" on its own. If your JSON is a bare array, wrap it in a key first, converting [1, 2, 3] to { "values": [1, 2, 3] }, and the conversion works normally.
Null has no TOML equivalent
Config formats like TOML are built around always-present, typed values, so there’s no null literal. A field with a null value in your JSON is dropped from the TOML output entirely rather than being written as an empty string or a comment. If a downstream tool depends on the key existing, replace null with an empty string, 0, or false before converting, depending on what the field means.
Common use: config files
JSON to TOML shows up most when migrating a Node config to a Rust or Python project, since Cargo and many Python tools read Cargo.toml or pyproject.toml natively. Test the output against your target tool’s schema afterward; TOML’s table syntax accepts several equivalent layouts for the same data, and this converter picks one consistently rather than matching a specific style guide.