What this tool does
A TOML document becomes JSON. Tables nest, and [[arrays of tables]] become arrays.
title = "Demo"
[server]
host = "localhost"
port = 8080
{
"title": "Demo",
"server": {
"host": "localhost",
"port": 8080
}
}
Dotted keys nest the same way: a.b.c = 1 gives you {"a": {"b": {"c": 1}}}.
Big integers, intact
snowflake = 1096285471735640155
{
"snowflake": 1096285471735640155
}
TOML asks for signed 64-bit integers, and JavaScript numbers hold only 53 bits exactly. The parser used to answer the whole document with “integer value cannot be represented losslessly” — a legal TOML file, refused, because of one identifier. The digits now travel as digits: the JSON is written by a lossless writer, the same one this site uses to keep large numbers intact everywhere else. That was a real defect, found while writing this page and fixed.
inf and nan are named, not nulled
rate = inf
JSON has no infinity: "rate" is inf
TOML has inf, -inf and nan; JSON has none of the three, and JSON.stringify writes them as null. An infinite rate became an absent rate, and nothing in the result said a thing. The converter now stops at the value and names the key that holds it, the way it already refuses a null on the way back to TOML. What to put there instead — a string, a very large number, no key at all — is a decision about your data, not a reading of it.
What JSON does not have
- A date type.
1979-05-27T00:32:00-07:00becomes the string"1979-05-27T00:32:00.000-07:00". The offset is kept; the milliseconds are written out even when the source had none. - Two kinds of number. TOML tells an integer from a float, JSON has one number:
1.0arrives as1. Convert back and you get an integer where you wrote a float. - Comments. They document the file, not the data, and there is nowhere to put them.
A file that starts with a byte order mark — the invisible U+FEFF a Windows editor likes to add — used to be refused with a message about the characters allowed in a key, pointing at a character you cannot see. It is now removed before reading.
Private by design
Everything runs locally in your browser with JavaScript. Your data is never uploaded, which makes the tool safe for sensitive content, and it keeps working offline.