How to use
- Paste TOML on the left, or click Load sample.
- Choose 2 or 4 spaces of indentation. The JSON appears as you type.
- If the TOML has a syntax error, such as a duplicate key or a missing value, the error shows the line where it fails.
- Copy or download the JSON, or click Swap direction to convert JSON back to TOML.
Options explained
- Indent
- Indentation of the JSON output, 2 or 4 spaces.
- Date-times
- TOML date-times become strings. Offset date-times keep their offset; local dates (such as 1979-05-27) and local times stay as they are, with no time zone added.
- Strict checks
- Duplicate keys and tables, invalid escapes and out-of-range integers are rejected as the spec requires, instead of being silently overwritten.
Example
TOML:
title = "TOML Example"
[owner]
name = "Tom"
dob = 1979-05-27T07:32:00-08:00
[database]
ports = [8000, 8001]
enabled = true
JSON:
{
"title": "TOML Example",
"owner": {
"name": "Tom",
"dob": "1979-05-27T07:32:00.000-08:00"
},
"database": {
"ports": [8000, 8001],
"enabled": true
}
}
Frequently asked questions
Which TOML version is supported?
TOML 1.0.0, including dotted keys, inline tables, multi-line basic and literal strings, hex/octal/binary integers, inf and nan (JSON has no such values, so they become null).
Are comments kept?
No. JSON has no comments, so comments in the TOML are dropped.
Can large integers lose precision?
TOML integers are 64-bit. Integers above 2^53 cannot be represented exactly in JavaScript, so the output may differ from the original. Typical config files never hit this.
Is my data uploaded?
No. Parsing and conversion run in your browser.
Privacy
This tool runs entirely in your browser. Your files and text are processed on your device and are never uploaded to our servers.