HCODX/JSON to TOML
100% browser-based · UTF-8 safe · No upload

JSON to TOML

Convert JSON to TOML using the @iarna/toml reference implementation. Preserves types (integers, floats, booleans, dates) and emits proper tables and inline arrays.

JSON input
TOML output
Options
Reverse (TOML → JSON)
Input size
0 B
Output size
0 B
Output lines
0
Status
Ready
Example

JSON in, TOML out

See exactly how JSON maps onto TOML — the converter on this page produces output identical to the example below.

JSON input
{
  "database": { "host": "localhost", "port": 5432, "enabled": true },
  "servers": {
    "alpha": { "ip": "10.0.0.1" },
    "beta": { "ip": "10.0.0.2" }
  }
}
TOML output
[database]
host = "localhost"
port = 5432
enabled = true

[servers]

[servers.alpha]
ip = "10.0.0.1"

[servers.beta]
ip = "10.0.0.2"
Use cases

What you'll use this for

Converting JSON to TOML is a daily task in API integration, config management, and data pipelines.

API integration

Generate Cargo.toml or pyproject.toml from JSON manifests.

Config migration

Move from JSON-based config to TOML for human-edited project files.

Data import

Bundle JSON metadata into TOML-consuming Rust or Python tools.

CI pipelines

Generate TOML configs from version-controlled JSON during builds.

Step by step

How to convert JSON to TOML

1

Paste your JSON

Drop it into the left editor. The sample is loaded by default — clear it or click the wand to reload.

2

Click Convert

Or leave auto-convert on for live updates. Conversion runs entirely in your browser — no upload.

3

Copy or download

Copy to clipboard or save the output as config.toml.

4

Reverse if needed

Jump to the TOML to JSON converter for a round-trip check.

FAQ

Frequently asked questions

Yes. TOML is strongly typed — integers, floats, booleans, strings, and dates remain distinct.

They become TOML tables ([section.subsection]) or inline tables for short objects.

Yes. No signup, no limits.

You'll see a clear parse error in the output panel.

Use the TOML to JSON converter for the opposite direction.

About

About JSON and TOML

TOML (Tom's Obvious Minimal Language) is a strongly-typed config format designed to be human-editable and unambiguous. It's the canonical format for Rust's Cargo.toml, Python's pyproject.toml, and many modern tools.

Common pitfalls

  • Keys must be valid bare keys or quoted strings.
  • Arrays of tables use the [[name]] syntax — handled automatically.
  • Dates are ISO-8601; strings with newlines use triple-quoted literals.
  • TOML cannot represent null — null fields are omitted.
Related

Related tools