TOML ↔ JSON / YAML Converter — Cargo, pyproject, Hugo
Skip to main content

TOML ↔ JSON / YAML Converter

Convert between TOML, JSON, and YAML. Handles tables, arrays of tables, and dotted keys.

From
To
Output (JSON)
{
  "title": "TOML Example",
  "server": {
    "host": "localhost",
    "port": 8080,
    "enabled": true
  },
  "products": [
    {
      "name": "Apple",
      "price": 1
    },
    {
      "name": "Banana",
      "price": 0.5
    }
  ]
}

About TOML ↔ JSON / YAML Converter

Convert between TOML, JSON, and YAML. Handles the everyday formats developers paste — Cargo.toml, pyproject.toml, Hugo config.toml — including tables, arrays of tables, and dotted keys. All conversion runs in your browser with no server round-trip.

Pipeline

Frequently asked

What is TOML?
TOML (Tom's Obvious Minimal Language) is a configuration file format designed to be easy to read and write. It is used by Rust projects (Cargo.toml), Python projects (pyproject.toml), Hugo static sites, and many other tools. It supports tables, arrays of tables, dotted keys, and typed scalars.
What TOML features does this tool support?
Key/value pairs, tables ([section]), arrays of tables ([[section]]), dotted keys (a.b.c = 1), basic strings (double-quoted with escape sequences), literal strings (single-quoted, no escapes), integers, floats, booleans, and inline arrays of scalars. Not supported: inline tables {a=1}, multiline strings, and datetime types (kept as strings).
Why does my TOML fail to parse?
Common causes: inline tables ({a = 1, b = 2}) are not supported by this tool — convert them to regular tables first. Multiline strings (triple-quoted) are also not supported. Duplicate keys in the same table will throw an error — TOML forbids them.
Can I convert JSON or YAML to TOML?
Yes — select JSON or YAML as the source format and TOML as the target. Arrays of objects become TOML arrays of tables ([[section]]). Nested objects become TOML tables ([section.subsection]). Note that TOML cannot represent all JSON structures — arrays of mixed types or arrays at the root level will not round-trip cleanly.
Is this tool useful for Cargo.toml or pyproject.toml?
Yes — paste your Cargo.toml or pyproject.toml to convert it to JSON for programmatic processing, or to YAML for comparison with other config formats. The tool handles the [[dependencies]] and [[tool.poetry.dependencies]] array-of-tables patterns used in these files.