DevKit
Converter

TOML to JSON

Convert TOML configuration files to JSON format.

Last updated: August 2026

Share:

Was this tool helpful?

Config in TOML, data in JSON

TOML is a configuration format built to be obvious to read and write by hand, used by Cargo, pyproject, and many tools. JSON is what programs prefer to consume. Converting TOML to JSON lets a config written for humans feed a pipeline that expects JSON, or lets you inspect how a TOML file actually nests.

How tables become objects

TOML's headline feature is tables, written with bracketed headers. A header like [server.http] creates nested objects: server containing http. That dotted header is the main thing people misread, since it looks flat but produces depth.

Example

TOML input:

title = "App"

[server]
host = "localhost"
port = 8080

JSON output:

{
  "title": "App",
  "server": {
    "host": "localhost",
    "port": 8080
  }
}

Types TOML has that JSON lacks

TOML has first-class dates and times, so 2024-01-01T00:00:00Z is a real datetime, not a string. JSON has no date type, so it becomes a string on conversion and the type information is lost. TOML also distinguishes integers from floats explicitly, while JSON blurs them into one number type.

FAQ

What is an array of tables? The [[products]] syntax repeats a table into a JSON array of objects, one per occurrence. It is TOML's way of writing a list of records.

Why did my date become a string? JSON cannot represent a native datetime, so the converter preserves the text but drops the type. Parse it back in your code.

Can I convert .env files too? Different format, use the .env to JSON converter for those.