Boneyard Tools

TOML to JSON Converter

Paste any TOML document to get JSON instantly. Tables, arrays of tables, dotted keys, inline tables and multiline strings are all supported. Your data stays in your browser.

How to convert TOML to JSON

  1. Paste or type your TOML, such as a Cargo.toml or pyproject.toml file.
  2. The JSON output updates live as you type.
  3. Pick an indent, then copy the JSON or download it as a .json file.

Examples

Table becomes a nested object

[owner]
name = "Ada"
active = true
{
  "owner": {
    "name": "Ada",
    "active": true
  }
}

Array of tables becomes an array of objects

[[server]]
host = "a"

[[server]]
host = "b"
{
  "server": [
    {
      "host": "a"
    },
    {
      "host": "b"
    }
  ]
}

Frequently asked questions

Is my data uploaded anywhere?

No. The conversion runs entirely in your browser, so your TOML never leaves your device.

Which TOML features are supported?

All of TOML v1.0: comments, bare/quoted/dotted keys, basic and literal strings (single and multiline), integers in decimal, hex, octal and binary, floats, booleans, date-times, arrays, inline tables, tables and arrays of tables.

How are TOML tables converted?

A [table] header becomes a nested JSON object and a [[table]] header becomes an array of objects. Dotted keys like a.b.c also expand into nested objects.

How are dates and times handled?

JSON has no date type, so TOML offset date-times, local date-times, dates and times are kept verbatim as JSON strings.

What happens to inf and nan?

JSON cannot represent infinity or not-a-number, so TOML inf and nan values are written as null. Everything else converts exactly.

Does it report errors?

Yes. If the TOML is malformed, the converter shows a parse error with the line and column so you can fix it quickly.

Related tools