Skip to content

Paste TOML, get JSON. Reads Cargo.toml, pyproject.toml, and Hugo config files.

Input — TOML
Output — JSON
Ctrl+Shift+CCopy

Share this tool

Found it useful? Help a fellow developer discover it.

https://developertoolkit.dev/tools/toml-to-json

Convert in the other direction

Going the other way, writing JSON config into a Cargo.toml or pyproject.toml?

Convert JSON to TOML

Open JSON to TOML Converter

Converting TOML to JSON: use cases and format differences

TOML has quietly become the default configuration format for a generation of developer tools. Every Rust project has a Cargo.toml. Every modern Python project using Poetry or Hatch has a pyproject.toml. Hugo, the most popular static site generator, uses TOML by default. The appeal is its readability. TOML is more explicit than YAML, since it has no indentation-sensitive parsing. It is also more human-friendly than JSON. TOML does not require quotes around every key, it supports comments, and it has native date types. Converting it to JSON is how you get those values into everything else: a script that reads dependency versions from Cargo.toml, a CI step that checks the version field in pyproject.toml with jq, or a test that asserts on a Hugo config. The conversion is lossless for every type both formats support. Tables become nested objects, array tables become arrays of objects, and datetimes become ISO 8601 strings, since JSON has no native date type. Comments are the one thing that does not carry over, because JSON has no comment syntax.

Frequently Asked Questions

What is TOML?

TOML (Tom's Obvious Minimal Language) is a configuration file format designed to be easy to read and write. It uses a simple key-value syntax with support for strings, integers, floats, booleans, datetimes, arrays, and tables (objects). It was created by Tom Preston-Werner, a co-founder of GitHub.

How is TOML different from YAML and JSON?

TOML is more readable than JSON for config files because it does not require quotes around keys and uses human-friendly syntax for sections and arrays. Compared to YAML, TOML has fewer edge cases and surprises. TOML is better suited for configuration files. JSON is better for data interchange. YAML is common in DevOps tooling like Kubernetes and Ansible.

Where is TOML used?

TOML is the configuration format for Rust projects (Cargo.toml), Python projects (pyproject.toml with Poetry or Hatch), the Hugo static site generator, the Zola static site generator, and many CLI tools. It is also the default config format for the uv Python package manager.

Does TOML support dates and datetimes?

Yes. TOML has native date, time, and datetime types. For example: published = 2026-03-16T10:30:00Z. When converting to JSON, these are serialized as ISO 8601 strings since JSON has no native date type.

How do [[double bracket]] array tables convert to JSON?

Each [[products]] header adds one object to an array called products. Two [[products]] blocks with a name key become "products": [{"name": "a"}, {"name": "b"}] in JSON. Single bracket [server] headers become nested objects instead, so [server] with port = 8080 becomes "server": {"port": 8080}.

Why does my TOML fail to convert?

The parser follows the TOML spec strictly. The most common errors are a key defined twice in the same table, a [table] header repeated, an unquoted string value, and an integer too large to represent exactly in JSON (above 9007199254740991). The parser rejects that last case with an error rather than silently rounding the number, so quote the value as a string if you need it preserved.

Related Tools