Paste JSON, get valid TOML. Built for Cargo.toml, pyproject.toml, and static site config. 100% in your browser.

Input — JSON
Output — TOML
Ctrl+Shift+CCopyCtrl+KClear

Share this tool

Found it useful? Help a fellow developer discover it.

https://developertoolkit.dev/tools/json-to-toml

Convert in the other direction

Going the other way, reading a Cargo.toml or pyproject.toml as JSON?

Convert TOML to JSON

Open TOML to JSON Converter

Why convert JSON to TOML?

TOML is the config format of the Rust and modern Python toolchains, and it is what static site generators reach for. JSON is what your scripts, APIs, and package registries hand you. So you end up needing a bridge: a generated dependency set that has to land in Cargo.toml, a build matrix computed in JavaScript that belongs in pyproject.toml, or a site config exported from a CMS that has to become a Hugo config file. TOML's table syntax is the part people get wrong by hand, because nested objects become bracketed section headers whose ordering matters. This converter handles that nesting for you.

How JSON types land in TOML

Maps directly

  • ·Objects become [table] sections, nested as [parent.child]
  • ·Arrays become TOML arrays with bracket syntax
  • ·Strings, integers, floats, and booleans carry over exactly
  • ·Arrays of objects become [[array-of-tables]] blocks

Worth knowing

  • ·null has no TOML equivalent and those keys are omitted
  • ·Top-level scalars are emitted before any table header
  • ·The top level must be an object, not an array
  • ·Date-like strings stay strings unless already TOML datetimes

How to convert JSON to TOML

  1. Paste a JSON object. TOML documents are always a table at the top level, so the input has to be an object. An array or a bare value is rejected with a message explaining why.
  2. Read the TOML output. It appears instantly on the right, with nested objects rendered as bracketed [table] sections.
  3. Note the key ordering. Top-level scalars and arrays are emitted before any table header, because in TOML every key after a header belongs to that table.
  4. Copy or download. Save the result as a .toml file, ready to commit.

Frequently Asked Questions

How do I convert JSON to TOML online?

Paste a JSON object into the left panel. This page opens already set to the JSON to TOML direction, so valid TOML appears on the right immediately. Copy it or download it as a .toml file. Everything runs in your browser.

Why does the converter reject my JSON array?

A TOML document is a table at the top level, which means the root has to be a set of key-value pairs. A JSON array has no keys at the root, so there is nothing to name the entries. Wrap the array in an object first, for example {"items": [ ... ]}, and it converts cleanly into an array or an array of tables.

What happens to null values in my JSON?

TOML has no null type, so keys whose value is null are omitted from the output rather than being written as an empty or placeholder value. If a key needs to exist in the TOML, give it a real value such as an empty string or false before converting.

Why do my top-level keys appear above the [table] headers?

That ordering is required by TOML, not a stylistic choice. Once a [table] header appears, every key that follows belongs to that table until the next header. Any top-level scalar or array therefore has to be written before the first header, otherwise it would be silently reparented into a table.

Can I use the output as a Cargo.toml or pyproject.toml?

The syntax will be valid TOML that Cargo and Python build backends parse. Whether the file is a valid manifest depends on your JSON containing the sections those tools require, such as [package] with name and version for Cargo. The converter represents your structure faithfully, it does not add required fields.

How are arrays of objects represented?

As TOML arrays of tables, written with double brackets, for example [[dependencies]] repeated once per element. This is the idiomatic TOML form and is what Cargo and most TOML consumers expect for repeated sections.

How do I convert TOML back to JSON?

Use the Swap button to flip direction in place with the current output as input, or open the TOML to JSON converter, a separate page written around reading Cargo.toml, pyproject.toml and Hugo config as JSON.

Is my configuration uploaded anywhere?

No. Parsing and serialization both happen in your browser with client-side JavaScript. Config files often carry registry tokens and deploy keys, so nothing is transmitted, stored, or logged.

Related Tools