TOML to JSON Converter

Convert TOML (Cargo.toml, pyproject.toml, config files) to JSON with full TOML 1.0 support: tables, arrays of tables, dates and big integers. Free.

Runs entirely in your browser. Your data is never uploaded.

Related Tools

View All

What is TOML to JSON?

Paste a TOML document such as Cargo.toml, pyproject.toml or an app config and get the equivalent JSON. Tables become objects, arrays of tables become arrays of objects and TOML dates become ISO 8601 strings.

How to use TOML to JSON

  1. Paste TOML into the TOML input box, or use Load sample or Open file.
  2. Choose the JSON Indentation.
  3. The JSON output updates as you type; use Copy or Download.

Example

Input
title = "T"
[db]
ports = [8000, 8001]
Output
{
  "title": "T",
  "db": {
    "ports": [
      8000,
      8001
    ]
  }
}

When to use TOML to JSON

Use it to inspect TOML configs, feed them to JSON tools or migrate settings. Comments and key formatting are not preserved, and the JSON cannot record whether a value was a TOML date or a string.

How TOML to JSON works

Parsing uses smol-toml, a TOML 1.0 compliant parser. Integers larger than 2^53 are kept exactly (written as plain JSON numbers instead of being rounded), offset date-times become UTC ISO strings, local dates and times are written as-is, and syntax errors are reported with their line number. inf and nan have no JSON equivalent and become null.

Common Use Cases

  • Inspect the dependency table of a Cargo.toml file
  • Convert pyproject.toml metadata for a script
  • Migrate a TOML app configuration to JSON
  • Validate TOML syntax and see where an error is

FAQs

How are dates converted?

Offset date-times become ISO 8601 UTC strings (2024-01-01T00:00:00.000Z); local dates like 1979-05-27 stay in that form.

Are big integers safe?

Yes, integers beyond JavaScript's safe range are parsed as BigInt and written as exact JSON numbers.

Is there a JSON to TOML option?

Not in this tool; it converts TOML to JSON only.

Good next steps

Explore more categories