Turn JSON settings in braces into TOML's plain name = value lines, nested groups and lists included.
FluffyShieldProtected workspace
Loading the tool…
The tool didn't load. Reload the page, or check whether an extension or network filter blocks .
Free · No upload · No sign-up · No usage quotas
What should a null become in TOML?
Nothing at all. TOML can't write an empty setting, so the setting has to go, and the converter stops at each null until it has.
FluffyBench · 3 min read · Reviewed
From JSON to TOML
Check the JSON is one set of braces with no null in it
→Write each setting as a name = value line
→Turn each nested group into a [heading] of its own
What it does
Plain settings move up
A setting that came after a nested object in the JSON is written above that object's table, so TOML doesn't count it as part of the table.
Lists of groups
A list of groups in braces becomes a run of headings written [[name]], one for each group.
Limits One set of braces at the top only: a list on its own is refused.
Order-app settings with two blanks in them
Orders at the bakery come in through an app that exports its settings as JSON, but the program that prints kitchen tickets wants them as TOML, a settings format of plain name = value lines. Two settings were never filled in: the proxy, a go-between computer that some office networks send web traffic through, and the user name for the mail server. JSON writes a setting with no value as null.
Paste the export, and the converter stops before writing a line: "$["proxy"]: TOML has no null value. Remove or replace it explicitly before converting."
TOML has no word for nothing
The TOML specification lists what a setting can hold: text, numbers, true or false, dates and times, lists and tables. There's no empty value, and it says outright that a setting with no value is invalid. A TOML file says a setting isn't set by leaving it out.
So the faithful way to carry "proxy": null across is to delete the line. Two shortcuts look tidier and say something else. proxy = "" is a setting, a piece of text with nothing in it, and a program may still try to use it as an address. proxy = "none" is a proxy called none. How a program treats a setting that isn't there is up to the program, so if yours lists its settings somewhere, check what it does without this one.
The mail settings, which sit in their own braces in the JSON, go under [mail] in the TOML: a heading in square brackets that groups the lines under it, which TOML calls a table.
Export, then TOML
With both null lines deleted, the TOML has no proxy and no mail user at all. How we checked
Clearing the nulls, one message at a time
Paste the exported settings into the JSON box.
Leave the box by tapping or clicking beside it, and read which setting the message under it names.
Delete that setting's whole line, here the one that reads "proxy": null.
Do the same for each setting the next message names, until the TOML box fills.
With the proxy line gone, ours stopped again at $["mail"]["user"], the user setting inside mail.
Deleting the last setting inside a pair of braces leaves a comma behind on the line above it, here the comma after "host": "smtp.example.com". Strict JSON doesn't allow a comma before a closing brace, so take that comma out too, or the next message will point at the brace on line 5 instead.