How JSON maps to TOML
TOML (Tom’s Obvious, Minimal Language) is a configuration format designed to be easy to read and to map unambiguously to a hash table. Every TOML document is a table, so the JSON you convert must have an object at the root. The converter follows the TOML 1.0 specification:
| JSON | TOML |
|---|---|
| string, number, boolean | key = "value", port = 8080, debug = false |
| nested object | a table header: [server], deeper levels as [server.timeouts] |
| array of values | features = ["refunds", "webhooks"] |
| array of objects | repeated [[admins]] sections |
| object inside a mixed array | inline table { name = "x" } |
null | no equivalent — written as a comment so you can decide |
Keys containing characters other than letters, digits, _ and - are quoted automatically, and strings are escaped as TOML basic strings.
How to use it
- Paste a JSON object or upload a
.jsonfile. - Check the status bar for any
nullvalues that were commented out. - Copy or download the
.tomlfile.
Example
JSON
{
"title": "App",
"server": {"port": 8080},
"admins": [{"name": "Asha"}, {"name": "Leo"}]
}TOML
title = "App"
[server]
port = 8080
[[admins]]
name = "Asha"
[[admins]]
name = "Leo"Frequently asked questions
Why do I get an error for a JSON array?
A TOML document must be a table (key/value pairs). Wrap the array in an object, e.g. {"items": [...]}.
What happens to null values?
TOML has no null type, so the key is written as a comment. Remove it or replace it with a default value.
Are dates converted to TOML datetimes?
JSON has no date type, so dates stay as quoted strings. Remove the quotes manually if you want native TOML datetimes.
Is my data uploaded?
No. Conversion runs in your browser.