100% local — your data never leaves your browser

TOML to JSON — Long IDs Survive Exactly

Convert TOML to JSON. Large integers keep every digit and dates keep their offset, so the config reaches your code as it was written.

Instant Private Zero cookies
Indentation

TOML input

JSON output

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:00 becomes 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.0 arrives as 1. 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.

Frequently asked questions

Does it handle 64-bit integers?
Yes, since this page was written. TOML requires signed 64-bit integers, and the parser used to refuse the whole document as soon as one went past what a JavaScript number holds exactly: “integer value cannot be represented losslessly”. A Discord id or a nanosecond timestamp was enough to reject a perfectly legal file. The digits now come through one for one, because the JSON is written by a lossless writer rather than by JavaScript’s own.
What happens to `inf` and `nan`?
The conversion stops and names the key. TOML has three special floats, JSON has none, and `JSON.stringify` writes them as `null` — an infinite rate quietly became an absent rate. Naming the key leaves the decision where it belongs: a string, a large number, a missing key, that is yours to pick.
And dates?
They become ISO 8601 strings, offset included, because JSON has no date type. One detail worth knowing: the milliseconds are spelled out even when you did not write them, so `07:32:00` arrives as `07:32:00.000`. The instant is the same; the text is not.

Related converters