DevToolsmith

TOML to JSON Converter

Paste a TOML file such as Cargo.toml, pyproject.toml or a config file to see it as JSON. Tables, arrays of tables, inline tables, dates and 64-bit integers are all handled per the TOML 1.0 spec.

Runs 100% in your browser — nothing is uploaded

TOML
Tip: drop a file here255 chars · 255 bytes · 14 lines
JSON
366 chars · 366 bytes · 23 lines

Example: Cargo.toml

TOML
[package]
name = "ripgrep-lite"
version = "0.2.0"
edition = "2024"

[dependencies]
regex = "1.11"
clap = { version = "4.5", features = ["derive"] }

[[bin]]
name = "rgl"
path = "src/main.rs"

[profile.release]
lto = true
opt-level = 3
JSON
{
  "package": {
    "name": "ripgrep-lite",
    "version": "0.2.0",
    "edition": "2024"
  },
  "dependencies": {
    "regex": "1.11",
    "clap": {
      "version": "4.5",
      "features": [
        "derive"
      ]
    }
  },
  "bin": [
    {
      "name": "rgl",
      "path": "src/main.rs"
    }
  ],
  "profile": {
    "release": {
      "lto": true,
      "opt-level": 3
    }
  }
}

TOML to JSON mapping

TOMLJSON
[table]object
[a.b.c] / dotted keysnested objects
[[array]]array of objects
{ x = 1 } inline tableobject
string, integer, float, booleanstring, number, number, boolean
date-time, date, timeRFC 3339 string
inf, nannot representable (becomes null)

Why convert TOML to JSON?

  • Query it with jq: pipe the JSON into jq to extract a version or list dependencies in scripts.
  • Debug table nesting: seeing the JSON makes it obvious which table a key actually belongs to.
  • Feed other tools: many APIs, linters and dashboards accept JSON but not TOML.
# Python 3.11+ has a TOML parser built in
python -c 'import sys, tomllib, json; print(json.dumps(tomllib.load(sys.stdin.buffer), indent=2, default=str))' < Cargo.toml

# Get the package version
python -c 'import tomllib; print(tomllib.load(open("pyproject.toml","rb"))["project"]["version"])'

Need the reverse? Use JSON to TOML.

Frequently asked questions

How do I convert TOML to JSON?

Paste TOML into the tool above, or drop a Cargo.toml, pyproject.toml or any .toml file onto it. It is parsed with a fully TOML 1.0 compliant parser and shown as formatted JSON. Syntax errors show the exact line and column.

How are TOML tables and arrays of tables converted?

A [table] becomes a JSON object, and dotted headers like [profile.release] become nested objects. Each [[array.of.tables]] entry becomes an object inside a JSON array. Inline tables { a = 1 } become objects too.

How are TOML dates converted?

JSON has no date type, so TOML offset date-times, local date-times, local dates and local times become strings in RFC 3339 format, such as "1979-05-27T07:32:00.000-08:00" or "1979-05-27".

What about very large integers?

TOML integers are 64-bit. Values above 2^53 can’t be stored exactly in a JavaScript number, so this tool parses them as BigInt and writes the exact digits to the JSON output.