JSON to TOML Converter
This JSON to TOML converter produces a configuration file from JSON, writing nested objects as tables such as [server.tls] and arrays of objects as arrays of tables such as [[endpoints]] — the two pieces of TOML syntax that are genuinely awkward to write by hand and easy to get subtly wrong. Two constraints are worth knowing up front, and both are reported clearly rather than producing broken output: a TOML document is always a table at the top level, so the JSON has to be an object rather than an array, and TOML has no null at all, so a null value has to be removed or given a real value before converting.
How it works
Converts JSON to TOML. Nested objects become tables written as [server.tls], and arrays of objects become arrays of tables written as [[endpoints]] — the two pieces of TOML syntax that are hardest to write by hand.
TOML documents are always a table at the top level, so the JSON has to be an object. TOML also has no null, so null values are reported rather than silently dropped.
Everything runs in your browser — nothing you paste is sent to a server.
Two rules, stated up front
The root must be an object. TOML documents are tables. A JSON array has no root representation, so it is rejected rather than wrapped in something you did not ask for.
There is no null. TOML deliberately omits it — the position being that an absent key is how you express absence. A null value is therefore reported by path, so you know exactly which one to deal with.
What good output looks like
title = "Checkout service"
[server]
host = "0.0.0.0"
port = 8080
[server.tls]
enabled = true
[[endpoints]]
path = "/health"
[[endpoints]]
path = "/admin"
Note that scalar keys have to come before any table header — everything after [server] belongs to
that table until the next header. Generating this correctly by hand is exactly the fiddly part.
Frequently asked questions
How do I convert JSON to TOML?
Paste an object into the left panel. The TOML appears on the right.
Why must the JSON be an object?
A TOML document is a table at the top level by definition. An array or a bare value has no valid TOML representation at the root.
What happens to null values?
They are reported rather than converted, because TOML has no null. Remove them or give them a real value first — the JSON cleaner can strip them for you.
How are arrays of objects written?
As arrays of tables, using the [[name]] syntax repeated once per element. That is the correct TOML form and the part most people get wrong by hand.
Are the keys quoted?
Only when they need to be. A key containing a dot, a space or other punctuation is quoted so it is not read as a path.
Is my data uploaded?
No. The conversion runs entirely in your browser.
Related tools
TOML to JSON Converter
This TOML to JSON converter keeps every type the format distinguishes.
TOML Validator
This TOML validator reports the first error with its line and column.
JSON to YAML Converter
This JSON to YAML converter turns JSON into clean YAML for Kubernetes manifests and CI config files.