100% Client-Side • Free • Zero Server Transfer

JSON to TOML Converter Online

Free online JSON to TOML converter for Cargo.toml, pyproject.toml and Hugo config. Nested objects become [table] headers and arrays stay inline. No upload.

JSON Input
TOML Output
In short

JSON to TOML conversion turns nested objects into [table] headers and key/value pairs into plain assignments. Paste JSON on the left and the right pane returns TOML you can paste straight into Cargo.toml, pyproject.toml or a Hugo config file.

TOML is a configuration format designed to map unambiguously onto a hash table while staying obvious to read. Converting from JSON turns nested objects into [table] headers, arrays of objects into [[array.of.tables]] blocks, and leaf values into plain key = value assignments. JSON2X does the conversion locally, which suits secrets that live in Cargo, Poetry, or Hugo configuration.

How do nested objects become tables?

Each level of nesting becomes a dotted table header. {"tool":{"ruff":{"line-length":100}}} converts to [tool.ruff] followed by line-length = 100. Arrays of objects use the double-bracket form, so {"bin":[{"name":"a"},{"name":"b"}]} becomes two [[bin]] blocks. This is why TOML reads well for configuration and poorly for data: it is optimised for a handful of named sections, not for a thousand uniform records.

Where does TOML differ from JSON?

TOML has a richer scalar set — first-class dates, times, and offset date-times, plus integers and floats as distinct types — and it allows comments, which JSON does not. It is also stricter in one respect: a table may not be defined twice, so duplicate keys that a lenient JSON parser would silently overwrite become an error. And ordering carries no meaning, so tools are free to reorder sections when they rewrite a file.

What does not convert cleanly?

Two things. null has no TOML representation at all — the convention is to omit the key entirely, so a JSON document that relies on explicit nulls loses that distinction. And a top-level JSON array cannot be a TOML document, because a TOML document is always a table; wrap it in a named key first. Deeply nested or heterogeneous structures technically convert but produce header-heavy output, which is a signal that YAML may be the better target.

How to use the JSON to TOML

Takes under a minute. Nothing is uploaded — every step runs in this browser tab.

  1. Paste JSON

    Put your configuration object into the left-hand input pane. Objects convert most cleanly; a top-level array has no direct TOML equivalent.

  2. Read the TOML

    The right-hand pane shows table headers for nested objects, inline arrays for primitive lists, and typed scalars for numbers, booleans, and dates.

  3. Paste into your config

    Drop the result into Cargo.toml, pyproject.toml, netlify.toml, or a Hugo config file.

When to use it

  • Adding a JSON-shaped block of settings to a Rust Cargo.toml
  • Moving Python project metadata into pyproject.toml for Poetry, Hatch, or Ruff
  • Writing a Hugo, Netlify, or Zola configuration from JSON you already have
  • Migrating a JSON config to TOML so it can carry comments
  • Documenting a settings schema in a format non-programmers can edit safely

Step-by-step guides for this tool

Task-specific walkthroughs covering the most common ways this tool gets used.

Searches this page answers

  • json to toml online free
  • free json to toml converter
  • json to toml converter online
  • convert json to cargo toml
  • json to pyproject toml
  • json to toml config
  • toml converter online
  • json to toml no upload

Frequently Asked Questions

What is TOML used for?

TOML (Tom's Obvious Minimal Language) is designed for clean, unambiguous configuration files, widely used in Rust (Cargo.toml), Python (pyproject.toml), and Hugo.

How are nested JSON objects converted to TOML?

Each nested object becomes a [table] header using its dotted path, and its scalar keys are listed underneath as plain assignments. Arrays of primitives are written inline, such as features = ["serde", "tokio"].

Why does it say the TOML root must be an object?

TOML documents are always a table of key/value pairs, so a top-level JSON array has no valid representation. Wrap the array in an object first — for example { "items": [...] } — and it converts cleanly.

Is this JSON to TOML converter free, and does it upload my config?

It is free with no account, and nothing is uploaded. Conversion happens in your browser, so a Cargo.toml or pyproject.toml containing registry tokens or private paths stays local.

Related Developer Tools

Last reviewed by the JSON2X Engineering Team.