TXT · Text & Data tools

TOML to JSON Converter

Input · TOML
Output · JSON
0 Bin0 Bout0lines in0keysEmptyTOML
Go to the full Data Format Converter

TOML to JSON

Convert TOML to JSON. Paste TOML on the left; the JSON output builds on the right as you type.

[package]
name = "vayce"
version = "1.0"

[[servers]]
host = "a.example.com"

[[servers]]
host = "b.example.com"

becomes

{
  "package": { "name": "vayce", "version": "1.0" },
  "servers": [{ "host": "a.example.com" }, { "host": "b.example.com" }]
}

[package] becomes a nested object under the package key. The two [[servers]] blocks, TOML’s syntax for an array of tables, become a JSON array with one object per block, in source order.

Typed values

TOML distinguishes strings, integers, floats, booleans, dates, and arrays at the syntax level, unlike CSV or plain text formats where everything is a string until you coerce it. That typing carries straight into JSON: a bare 42 becomes the number 42, and true becomes the boolean true, no coercion step needed on this side.

Reading config files

TOML to JSON is the direction you’ll use most when a Rust or Python project’s config, Cargo.toml, pyproject.toml, config.toml, needs to feed a JavaScript build step or a debugging script that expects JSON. Paste the whole file; comments in the source are dropped, since JSON has no comment syntax.

Parse errors

TOML is strict about table redefinition and duplicate keys within the same table, both of which fail to parse rather than silently overwriting. The input pane’s error footer reports the exact line, which is usually enough to spot a copy-paste duplicate or a table declared twice.

Frequently Asked Questions

A [table] header becomes a nested object under that key, and a dotted table name like [package.metadata] becomes nested objects two levels deep, matching the dots exactly.

It becomes a JSON array of objects, one entry per [[servers]] block in the source, in the order they appear.

Yes. A TOML datetime like 2024-01-15T10:00:00Z converts to a JavaScript Date internally and is written to the JSON output as an ISO 8601 string.

The input pane reports the line and column where parsing stopped. Common causes are a value missing its quotes, a duplicate key in the same table, or a table redefined after it was already used.

Yes, paste the file contents as-is. Both are standard TOML, so tables like [dependencies] or [tool.poetry] convert the same way any other TOML table does.

Jump straight to a conversion

Full Data Format Converter tool

Explore Our Tools

Browse all tools