Home/Developer Tools/TOML to JSON

TOML to JSON Converter

Bidirectional converter for TOML 1.0 and JSON. Paste a pyproject.toml, Cargo.toml, or any config and convert it instantly. Tables, arrays, datetimes, dotted keys all supported. Processing runs entirely on your device.

TOML Input 0 chars
Waiting for input
JSON Output 0 chars
Idle

About TOML to JSON Conversion

TOML and JSON serve overlapping but distinct purposes. TOML was designed to be obvious and minimal for humans writing configuration by hand, which is why projects like Rust's Cargo, Python's Poetry and Hatch, and many CLI tools adopted it. JSON, in contrast, is the lingua franca of machines, APIs, and tooling. Translating between them is a common need whenever a configuration value written in TOML has to be loaded by something that expects JSON, or when a JSON config is being migrated to a more readable hand-edited format.

Supported TOML 1.0 Features

Quick Example

# Cargo.toml style input
[package]
name = "my-crate"
version = "0.1.0"
authors = ["Jane <[email protected]>"]

[dependencies]
serde = { version = "1.0", features = ["derive"] }
tokio = "1.30"

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

Becomes:

{
  "package": {
    "name": "my-crate",
    "version": "0.1.0",
    "authors": ["Jane <[email protected]>"]
  },
  "dependencies": {
    "serde": { "version": "1.0", "features": ["derive"] },
    "tokio": "1.30"
  },
  "bin": [
    { "name": "cli", "path": "src/main.rs" }
  ]
}

How It Works

The converter parses TOML using a rigorous hand-written recursive descent parser that tokenizes line by line, tracking table context, key paths, and value types. Datetime values are preserved as RFC 3339 strings on the JSON side because JSON has no native datetime type. For the reverse direction, JSON objects become TOML tables, JSON arrays of objects become arrays of tables when possible, and primitive types map directly. All processing executes locally on your device.

💡 Frequently Asked Questions

TOML (Tom's Obvious Minimal Language) is a configuration format used by Rust's Cargo.toml and Python's pyproject.toml. Converting to JSON makes it consumable by JavaScript tooling, web APIs, and any system that already speaks JSON. The reverse direction is useful when migrating JSON configs to a more human-readable format.
This tool implements the TOML 1.0.0 specification, including basic and literal strings (single and multi-line), integers (with hex, octal, binary, and underscore separators), floats (including inf and nan), booleans, datetimes, arrays, inline tables, regular tables, and arrays of tables with dotted keys.
TOML → JSON is lossless for data, but comments are dropped because JSON has no comment syntax. JSON → TOML preserves all values; null is not representable in TOML and is skipped with a warning. Datetime strings in JSON stay as strings in TOML unless they match the ISO 8601 pattern exactly.
No. The parser and serializer run entirely in your browser using JavaScript. Nothing is sent to any server, no analytics track your input, and the page works completely offline once loaded.
Yes — that is exactly what this tool is built for. Both formats follow standard TOML syntax and parse without modification. The output will be a nested JSON object matching the table structure of the original.