TOML to JSON

Convert and validate TOML — Cargo, pyproject and config files.

Runs in your browser Instant No sign-up
Indent
TOML input
JSON
Reverse

Paste, type or drop a file — output appears as you type.

Waiting for input
Processed locally · nothing is uploadedProcessed locally

How to use the TOML to JSON converter

  1. Paste or drop a .toml file into the left pane, such as Cargo.toml, pyproject.toml, a Hugo or Netlify config, or an app settings file. The JSON appears as you type.
  2. Indent: 2 spaces, 4 spaces, tabs, or Minify for a single line.
  3. Copy or Download the result as output.json.

If the TOML is invalid, the error names the problem with its exact line and column instead of producing partial output.

Example

[package]
name = "tidy-api"
version = "0.4.2"

[profile.release]
lto = true
opt-level = 3

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

becomes

{
  "package": { "name": "tidy-api", "version": "0.4.2" },
  "profile": { "release": { "lto": true, "opt-level": 3 } },
  "bin": [{ "name": "api", "path": "src/main.rs" }]
}

Tables become nested objects, dotted keys such as profile.release become nested objects too, and arrays of tables ([[bin]]) become arrays of objects.

Details that matter

  • Dates stay readable. TOML date and time values are written as ISO 8601 text that keeps the original form: with an offset, as a local date-time, as a date only or as a time only.
  • 64-bit integers stay exact. IDs larger than 2^53 are not rounded.
  • inf and nan become null, with a warning, because JSON can’t represent them.
  • Duplicate keys and redefined tables are errors, as the TOML specification requires, so you find mistakes that some lenient parsers hide.

When to use it

  • Inspecting a project file. See the full structure of Cargo.toml or pyproject.toml as JSON, then query it with the JSONPath Tester.
  • Feeding JSON-only tools. Many CI systems, linters and schema validators read JSON but not TOML.
  • Generating types for a config file with JSON to TypeScript.
  • Converting to other formats. Need YAML or XML instead? The Data Format Converter goes from TOML to any supported format in one step.

TOML compared with JSON and YAML

TOML is designed to be easy to read and edit by hand: it has comments, a clear table syntax and real date types, and unlike YAML its indentation never changes the meaning. That makes it popular for project files in Rust, Python and Go. JSON is the format most programs and APIs exchange, so converting is the quickest way to inspect a TOML file with JSON tools, validate it against a JSON Schema, or load it in a language without a TOML parser.

Need the reverse? Click Reverse above the output or open JSON to TOML.

Frequently asked questions

Does it validate TOML?

Yes. Every document is parsed with a full TOML 1.0 parser before anything is written, and a syntax error stops the conversion with its line and column, for example "invalid value" when a key has nothing after the equals sign. The line is highlighted in the editor so you can jump straight to it.

What happens to TOML dates and times?

JSON has no date type, so offset date-times, local date-times, local dates and local times become ISO 8601 strings that keep their original form: 1979-05-27T07:32:00-08:00 stays with its offset, and a date-only value like 2026-10-05 stays a plain date. A warning tells you how many values were converted.

Are large integers kept exact?

Yes. TOML integers are 64-bit, and a JavaScript number only holds 53 bits exactly, so integers beyond that are kept as exact digits in the JSON instead of being rounded. Smaller integers stay ordinary numbers.

What about inf and nan?

TOML allows inf, -inf and nan as floats, but JSON has no way to write them. They become null, and a warning tells you how many values were affected so nothing changes silently.

Is my TOML uploaded?

No. The conversion runs in your browser, so Cargo.toml, pyproject.toml or any config file you paste never leaves your device.

Last updated