TOML ↔ JSON Converter

Convert TOML to JSON or JSON to TOML instantly. Supports tables, arrays of tables, inline tables, and all TOML value types. 100% client-side.

TOML Input
JSON Output
Paste TOML or JSON above to convert.

How to Use the TOML to JSON Converter

  1. Choose a direction — "TOML to JSON" or "JSON to TOML" using the mode chips.
  2. Paste your data into the input area. The conversion happens as you type.
  3. View the result on the right side with proper formatting.
  4. Copy or download the output as a .json or .toml file.

What is TOML?

TOML (Tom's Obvious Minimal Language) was created by Tom Preston-Werner (GitHub co-founder) as a configuration file format that is easy for humans to read and write while mapping unambiguously to a hash table. It is designed to be a better alternative to INI files (which have no standardized format) and YAML (which has complex edge cases). TOML is now used as the standard configuration format in Rust (Cargo.toml), Python packaging (pyproject.toml), Hugo (config.toml), and many other developer tools.

TOML Value Types

  • Strings — basic strings use double quotes ("value"), literal strings use single quotes ('value', no escape sequences)
  • Integers — plain numbers without decimal points: 42, -17, 1_000_000
  • Floats — numbers with decimal points: 3.14, 6.626e-34
  • Booleans — lowercase only: true, false
  • Arrays — comma-separated values in brackets: [1, 2, 3], can span multiple lines
  • Inline tables — compact object notation: { x = 1, y = 2 }
  • Tables[section] header creates a nested object
  • Array of tables[[array]] header appends objects to an array

TOML vs. YAML vs. JSON for Config Files

All three formats are used for configuration, but each has strengths. JSON is the most universally supported but does not allow comments and has verbose syntax. YAML is very compact and human-readable but has significant footguns — indentation-sensitive syntax, implicit type coercion (e.g., yes becomes true, Norwegian country code NO becomes false), and complex edge cases. TOML is the safest choice for configuration: it supports comments, has unambiguous syntax, and maps directly to a simple data structure. Most Rust and Python developers prefer TOML for these reasons.

Common TOML Patterns

The [[products]] / [[products]] pattern (array of tables) is one of TOML's most useful features for configuration. Each [[products]] block appends a new object to the products array, making it easy to define lists of configurations without verbose array syntax. Dotted keys (a.b.c = "value") are equivalent to nested tables and can be used to set values deep in the hierarchy on a single line. Inline tables ({ key = "value" }) keep simple sub-objects on one line for readability.

Using This Converter for Cargo.toml

Cargo.toml is the package manifest for Rust projects and uses TOML format. It defines the package name, version, Rust edition, dependencies, features, and workspace configuration. Use this converter to inspect a complex Cargo.toml as JSON for easier programmatic analysis, or to convert a JSON representation back to TOML format. When working with tools that output Cargo metadata as JSON (e.g., cargo metadata --format-version 1), this converter helps you cross-reference the JSON with the original TOML structure.

Frequently Asked Questions

TOML (Tom's Obvious Minimal Language) is a configuration file format designed to be easy to read due to its simple and unambiguous semantics. It maps to a hash table and is used in many tools including Rust's Cargo.toml, Python's pyproject.toml, Hugo static site generator, and many other developer tools.
This converter supports the core TOML specification: key = "value" pairs (strings, integers, floats, booleans), [section] table headers, [[array]] array of tables, inline tables { key = "value" }, arrays [ item1, item2 ], multi-line basic strings, and comments (# prefix). Datetime values are treated as strings.
No. This TOML/JSON converter runs 100% in your browser using JavaScript. Your data never leaves your machine. There is no server-side processing, no logging, and no data collection.
[section] defines a single table (object in JSON). [[array]] defines an array of tables — each time [[array]] appears, a new object is appended to the array. This is the TOML equivalent of a JSON array of objects and is commonly used for things like [[package.dependencies]] or [[servers]] in configuration files.
TOML is widely used as a configuration format in developer tools. Rust uses it for Cargo.toml (package manifest). Python uses pyproject.toml (PEP 517/518). The Hugo static site generator uses config.toml. It is preferred over JSON for config files because it supports comments and is easier to read and edit by hand.