Example
{
"title": "Edge proxy",
"server": {
"host": "0.0.0.0",
"port": 8443,
"tls": {
"cert": "/etc/ssl/proxy.pem"
}
},
"upstreams": [
{
"name": "api",
"url": "http://10.0.0.5:3000",
"weight": 3
},
{
"name": "web",
"url": "http://10.0.0.6:8080",
"weight": 1
}
]
}
title = "Edge proxy"
[server]
host = "0.0.0.0"
port = 8443
[server.tls]
cert = "/etc/ssl/proxy.pem"
[[upstreams]]
name = "api"
url = "http://10.0.0.5:3000"
weight = 3
[[upstreams]]
name = "web"
url = "http://10.0.0.6:8080"
weight = 1
The nested server.tls object becomes its own [server.tls] table. Each upstream becomes
an [[upstreams]] entry, which is how TOML expresses a list of objects.
When to use TOML instead of JSON
TOML is designed for configuration that humans edit. It supports comments, has an unambiguous syntax (unlike
YAML's indentation rules), and has first-class date and time types. That's why it's used by
Cargo.toml (Rust), pyproject.toml (Python), Hugo, Netlify, Deno and many CLI tools.
| Feature | JSON | TOML | YAML |
|---|---|---|---|
| Comments | No | Yes | Yes |
| Null | Yes | No | Yes |
| Dates | No (strings) | Yes | Partial |
| Whitespace-sensitive | No | No | Yes |
| Deep nesting | Easy | Verbose | Easy |
For deeply nested data, YAML is often more compact. Converting a TOML file back? Use TOML to JSON.
Frequently asked questions
How do I convert JSON to TOML?
Paste a JSON object into the tool above. Simple values become key = value pairs, nested objects become [table] sections, and arrays of objects become [[array of tables]]. Copy or download the result as a .toml file.
Why does my JSON fail to convert?
A TOML document is always a table, so the top-level JSON value must be an object, not an array or a single value. Wrap it, for example as {"items": [...]}.
What happens to null values?
TOML has no null. The converter removes null values and lists their paths under the output, so you can decide whether to delete the key, use an empty string, or use a sentinel value.
Is mixing types in an array allowed?
Yes, since TOML 1.0 arrays may contain mixed types, such as [1, "a"]. Arrays made only of objects are written as arrays of tables for readability.