TOML to JSON Converter

Convert any TOML configuration file to clean, formatted JSON output in seconds. Paste your TOML, get valid JSON instantly. Free, private, no signup required.

Open TOML to JSON Converter →

What is TOML?

TOML (Tom's Obvious, Minimal Language) is a configuration file format created by Tom Preston-Werner, co-founder of GitHub. It was designed with a single guiding principle: a config file should be easy to read as a human and map unambiguously to a hash table. The first stable release of the TOML specification was published in 2021.

A basic TOML file looks like this:

[package]
name = "my-app"
version = "1.0.0"
authors = ["Alice <alice@example.com>"]
edition = "2021"

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

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

After conversion, the equivalent JSON output is:

{
  "package": {
    "name": "my-app",
    "version": "1.0.0",
    "authors": ["Alice <alice@example.com>"],
    "edition": "2021"
  },
  "dependencies": {
    "serde": { "version": "1.0", "features": ["derive"] },
    "tokio": "1.35"
  },
  "profile": {
    "release": { "opt-level": 3, "lto": true }
  }
}

TOML vs JSON vs YAML: A Comparison

All three formats are used to represent structured configuration data. Each has different design goals and trade-offs. Here is how they compare across the dimensions that matter most:

Feature TOML JSON YAML
CommentsYes (#)NoYes (#)
Native date/time typesYesNo (strings)Partial
Indentation-sensitiveNoNoYes
Verbosity for deep nestingHighLowLow
Browser/JS native supportNo (library needed)Yes (JSON.parse)No (library needed)
Typical useConfig filesAPIs, data exchangeConfig, CI/CD pipelines

TOML is the clearest winner for human-edited configuration files where comments are important and the structure is relatively flat. JSON wins for machine-generated data and API communication. YAML is common in DevOps tooling like Kubernetes and GitHub Actions.

How to Convert TOML to JSON

  1. Open your .toml file in a text editor (or copy from your terminal).
  2. Click "Open TOML to JSON Converter" above to launch the tool.
  3. Paste your TOML content into the input panel on the left.
  4. The JSON equivalent appears instantly in the output panel on the right.
  5. Click "Copy" to copy the JSON output to your clipboard.
  6. Optionally click "Prettify" to format the JSON with consistent indentation.

The conversion is entirely client-side. Your TOML data never leaves your browser, making this safe for configuration files containing secrets, tokens, or passwords.

Common TOML Use Cases

Rust and Cargo (Cargo.toml)

Every Rust project uses a Cargo.toml manifest to declare package metadata, dependencies, and build profiles. The Cargo package manager reads this file to resolve dependency versions, compile features, and produce build artifacts. Converting a Cargo.toml to JSON is useful when writing tooling that needs to programmatically read project metadata using a standard JSON parser.

Hugo static site generator (config.toml)

Hugo, one of the fastest static site generators, uses TOML as its primary configuration format via config.toml. Site settings like baseURL, languageCode, menu definitions, and theme parameters are all stored in TOML. Developers migrating to or from Hugo often need to convert between TOML and JSON or YAML configuration formats.

Python packaging (pyproject.toml)

PEP 517 and PEP 518 standardized the use of pyproject.toml for Python project configuration. Build backends like Poetry, Flit, and Hatch all use this file for dependency declarations, build system requirements, and tool configuration. Converting pyproject.toml to JSON is helpful when integrating Python project metadata into JavaScript-based tooling or CI pipelines.

Gitea and Forgejo (app.ini / config.toml)

Several self-hosted Git platforms and developer tools use TOML for their server-side configuration. Being able to inspect and convert these files helps with configuration audits, migration scripts, and infrastructure-as-code tooling that reads configuration in JSON format.

Frequently Asked Questions

What is TOML and who uses it?

TOML (Tom's Obvious, Minimal Language) is a configuration file format designed by Tom Preston-Werner. It is widely used in the Rust ecosystem (Cargo.toml for package manifests), Hugo static site generator, Python's pyproject.toml, and many other developer tools. Its goal is to be easy to read as a human, with an unambiguous mapping to a hash table data structure.

Why would I need to convert TOML to JSON?

Many APIs, configuration systems, and JavaScript tools consume JSON but not TOML. Converting TOML to JSON lets you feed TOML-based config data into JavaScript applications, REST APIs, databases, or any system that natively understands JSON. It is also useful for inspecting TOML structure in a format you may already be more familiar with, or for migrating configuration between systems that use different formats.

Are TOML dates and times preserved when converting to JSON?

TOML has native date, time, and datetime types that have no direct equivalent in the JSON specification. During conversion, TOML datetime values are serialized as ISO 8601 strings in the JSON output. For example, a TOML value of 2024-01-15T10:00:00Z becomes the JSON string "2024-01-15T10:00:00Z". The value is preserved but the type information is lost.

Is my TOML configuration data sent to a server?

No. All conversion happens entirely in your browser using JavaScript. Your TOML data never leaves your machine and is never stored or transmitted anywhere. This makes the tool safe for converting configuration files that may contain sensitive values like API keys, database credentials, or authentication tokens.

Ready to convert your TOML to JSON?

Free, instant, 100% private. No account needed.

Open TOML to JSON Converter →

Also useful: JWT Decoder | JSON Validator | JSON Formatter | YAML to JSON | XML to JSON | CSV to JSON