WebToolsPlanet
Converter Tools

JSON to TOML Converter

Paste JSON and get the equivalent TOML — nested objects become `[table.headers]`, arrays of objects become `[[array of tables]]`, and keys are quoted when needed.

Last updated: May 27, 2026

Client-Side Processing
Input Data Stays on Device
Instant Local Execution

Find this tool useful? Support the project to keep it free!

Buy me a coffee

What is JSON to TOML Converter?

TOML (Tom's Obvious Minimal Language) is a configuration format designed to be unambiguous and easy to read. It is the canonical config format for Cargo (Rust), Poetry (Python), and many other tools. The interesting parts of TOML are its table headers — `[server.database]` — and its array of tables syntax — `[[products]]` — which let you express nested structures without indentation.

Converting from JSON is straightforward in principle but requires care for nested arrays of objects. This tool walks the JSON tree, emitting scalar fields first, then nested tables, then arrays of tables. Keys that contain characters outside the bare-key set (`[A-Za-z0-9_-]`) are automatically quoted.

How to Use JSON to TOML Converter

1

Paste a JSON object into the input panel (root must be an object).

2

Optionally enable alphabetical key sorting for canonical output.

3

Copy the generated TOML and use it in your config file.

Common Use Cases

  • Migrating a JSON config file to a TOML-based tool (Cargo, Poetry, Hugo).
  • Generating TOML config samples from a JSON schema example.
  • Producing a readable TOML view of a JSON document for documentation.
  • Round-tripping between JSON and TOML representations.

Example Input and Output

A nested JSON object becomes TOML with table headers.

JSON input
{ "title": "Example", "server": { "host": "localhost", "port": 8080 } }
TOML output
title = "Example"

[server]
host = "localhost"
port = 8080

Privacy

All conversion happens in your browser. No JSON is sent to a server.

Mixed-type arrays

TOML 1.0 allows arrays containing different value types (e.g. [1, "two", true]). This tool emits them as TOML inline arrays. If your consumer requires homogeneous arrays, validate the JSON before conversion.

Frequently Asked Questions

Why must the root be a JSON object?
TOML documents are always tables (key/value collections) at the root. A JSON array or primitive has no equivalent root form in TOML.
How are null values handled?
TOML has no null type. This tool silently drops null fields. To represent absence explicitly, omit the key from the JSON before conversion.
What about dates?
JSON has no date type. ISO-8601 strings in your JSON will be emitted as TOML strings; to get TOML date-time literals, post-process the output manually.
Does this send my JSON anywhere?
No. All conversion happens locally in your browser.