TOML to JSON

What is a Toml To Json?

TOML (Tom's Obvious, Minimal Language) is a configuration format designed to be easy for humans to read and write. It is used by Cargo.toml in Rust, pyproject.toml in Python, Hugo, Netlify and many CLI tools. Converting TOML to JSON is useful when you need to process the configuration in code, validate it against a JSON schema or inspect its exact structure.

How to use it

  1. Paste TOML content.
  2. Copy the resulting JSON.

Example

Input:

[package]
name = 'my-app'
version = '0.3.1'

[dependencies]
serde = { version = '1.0', features = ['derive'] }

[[bin]]
name = 'server'

Output (written here with single quotes):

{ 'package': { 'name': 'my-app', 'version': '0.3.1' },
  'dependencies': { 'serde': { 'version': '1.0', 'features': ['derive'] } },
  'bin': [ { 'name': 'server' } ] }

How TOML maps to JSON

  • [table] headers become nested objects.
  • [[array.of.tables]] becomes an array of objects.
  • Dotted keys like a.b.c = 1 create nested objects.
  • Inline tables { x = 1 } become objects.
  • TOML dates and times, such as 1979-05-27T07:32:00Z, have no JSON equivalent and become ISO 8601 strings.

Common TOML errors

  • Defining the same key or table twice.
  • Mixing types in arrays was forbidden in TOML 0.5 but is allowed in 1.0.
  • Unquoted string values: name = my-app is invalid.

Frequently Asked Questions

What is TOML used for?

Configuration files, such as Cargo.toml in Rust, pyproject.toml in Python, and config files for Hugo, Netlify and many command-line tools.

What does double square bracket syntax mean in TOML?

It defines an array of tables. Each [[name]] block adds one object to the name array.

How are TOML dates converted to JSON?

JSON has no date type, so TOML dates and times become ISO 8601 strings.

Why does my TOML fail to parse?

Common causes are duplicate keys or tables and string values without quotes.