TOML ⇄ JSON Converter

Client-sideNo sign-upFree

Convert TOML to JSON or JSON to TOML in either direction, powered by a spec-compliant parser.

Quick facts

Category
Converters
Best for
Reading a Cargo.toml or pyproject.toml config file as JSON for scripting
TOML
JSON
{ "title": "Formatiq config", "owner": { "name": "Formatiq", "dob": "2020-01-01T00:00:00.000Z" }, "database": { "enabled": true, "ports": [ 8001, 8002, 8003 ], "data": [ [ "gamma", "delta" ], [ 1, 2 ] ] }, "servers": { "alpha": { "ip": "10.0.0.1", "role": "frontend" }, "beta": { "ip": "10.0.0.2", "role": "backend" } } }
✓ Converted
Powered by @iarna/toml, a spec-compliant TOML parser - handles nested tables, arrays of tables, inline tables, and native TOML dates rather than a hand-rolled parser guessing at TOML's syntax. Working with YAML or INI config instead? See the JSON ⇄ YAML Converter or INI ⇄ JSON Converter.
In-content slot
Was this tool helpful?
On this page

Overview

Convert TOML to JSON or JSON back into TOML, using @iarna/toml - a spec-compliant TOML parser and serializer - rather than a hand-rolled implementation. TOML is meaningfully more complex than INI: it has nested tables, array-of-tables ([[section]] syntax for repeated table entries), inline tables, typed values including native dates, and multiple numeric formats (hex, octal, binary, underscore separators), all of which a from-scratch parser risks mishandling silently on real-world files. Useful for reading a Cargo.toml, pyproject.toml, or other TOML config as JSON for scripting, or generating a TOML file from a JSON config object. Note that JSON has no native date type, so a date that started as a real TOML date becomes a plain string after a JSON round-trip rather than converting back to a native TOML date automatically. Runs entirely client-side.

Best for: Reading a Cargo.toml or pyproject.toml config file as JSON for scripting

How to use this tool

  1. Pick a direction. Switch between TOML → JSON and JSON → TOML with one click.
  2. Paste your input. Drop in a TOML config file or a JSON object.
  3. Read the converted output. Nested tables, arrays of tables, and typed values are all handled by the underlying spec-compliant parser.
  4. Swap and repeat. Use the swap button to feed the output straight back in as new input.

Why use this tool

Spec-compliant parsing

Handles TOML’s full feature set - nested tables, array-of-tables, inline tables, typed dates - rather than a partial hand-rolled parser.

Catches real TOML syntax errors

Malformed TOML is rejected with a specific parser error rather than silently misparsed.

Handles Cargo/pyproject-style configs

Works cleanly with the kind of real-world TOML files Rust, Python, and other modern toolchains actually use.

Nothing leaves your browser

Conversion happens entirely client-side - useful when the config contains real credentials or connection details.

Frequently asked questions

The underlying parser is spec-compliant, so a failure usually means the input has a genuine syntax error - an unclosed string, a malformed table header, or a value that doesn’t match TOML’s expected types. The error message names the specific problem the parser hit.

TOML has a native date/time type, but JSON doesn’t - a TOML date becomes a JSON string after conversion. Converting that JSON back to TOML will keep it as a quoted string rather than automatically restoring it as a native TOML date, since there’s no reliable way to tell a date-shaped string from an intentional string value.

TOML supports nested tables, array-of-tables, inline tables, multiple numeric formats, and native dates - enough interacting syntax features that a hand-rolled parser risks silently mishandling real-world config files rather than failing loudly. A spec-compliant parser avoids that risk.

Explore more free tools

Formatters, converters, validators, and generators - all free and running entirely in your browser.

Browse more tools