Skip to content
Tools

JSON to TOML Converter

Last updated:

Paste a JSON object and get TOML: top-level values as key = value lines, nested objects as [tables] and arrays of objects as [[arrays of tables]]. TOML is stricter than JSON, so the converter also tells you when something cannot be expressed, such as null.

Runs in your browser: your config never leaves your device – nothing is uploaded, logged or stored on a server. How we protect your data

100% in-browserNothing is uploaded

Input

Loading editor…

Paste JSON here

or drop a file anywhere in this box. Everything stays in your browser.

Drop a file to load it

Output

Loading editor…

TOML appears here

Results update as you type.

How to use the JSON to TOML

  1. Paste a JSON object (TOML documents must be a table at the root).
  2. Fix anything reported as unsupported, most often null values.
  3. Review the output: simple values come first, then tables, as TOML requires.
  4. Copy it into Cargo.toml, pyproject.toml, config.toml or wherever it belongs.

Worked example

A site config with a nested table and a list of servers

Input

{"title":"site","port":8080,"owner":{"name":"Ada"},"servers":[{"host":"a","weight":1},{"host":"b","weight":2}]}

TOML

title = "site"
port = 8080

[owner]
name = "Ada"

[[servers]]
host = "a"
weight = 1

[[servers]]
host = "b"
weight = 2

Plain keys must come before any [table] header, because every key after a header belongs to that table.

TOML limits compared with JSON

TOML limits compared with JSON
JSON allowsTOMLWhat to do
nullNo null typeRemove the key or use an empty string / sentinel
Array at the rootRoot must be a tableWrap it: {"items": [...]}
Integers of any sizeSigned 64-bit onlyStore larger values as strings
Any key stringBare keys A–Z a–z 0–9 _ -; others quotedConverter quotes keys automatically
Numbers like 1e400Must fit a 64-bit floatStore as a string

Inline tables vs. sections

TOML offers two ways to write a nested object: a [section] header, or an inline table on one line, such as owner = { name = "Ada" }. Sections are easier to read for anything with more than two or three keys; inline tables suit small values inside arrays. In TOML 1.0 inline tables must fit on one line and cannot be extended later.

Dates and typed values

TOML has native date-time types (2026-10-29T08:00:00Z without quotes). JSON stores dates as strings, so the converter writes them as quoted strings to preserve the original type. Remove the quotes by hand if the consuming program expects a real TOML date.

JSON to TOML FAQ

Does TOML support null?

No. TOML has no null value. Omit the key, which most programs treat as "not set", or pick an explicit placeholder that the program understands.

What is [[double bracket]] syntax in TOML?

It declares an array of tables. Each [[servers]] header starts a new object appended to the servers array, matching a JSON array of objects.

Can TOML arrays mix types?

Since TOML 1.0.0, yes: [1, "two", 3.0] is valid. Older parsers built for v0.5 may reject it.

Why must my JSON be an object to convert to TOML?

A TOML document is always a table of key/value pairs. A top-level array or bare value has no TOML representation, so wrap it in an object with a key.

Is TOML or YAML better for config files?

TOML is explicit and hard to mis-indent, which is why Rust (Cargo) and Python (pyproject.toml) chose it. YAML is more compact for deeply nested data. Both are fine; follow your tool's convention.

Related tools