Skip to content
ToolMug

TOML to JSON Converter

Convert TOML config to JSON to process it in code or check the real structure of files like Cargo.toml and pyproject.toml. Parsing follows the TOML 1.0 spec, and syntax errors show the line and column.

Runs in your browser — nothing you enter is uploaded

TOML → JSON
Output (JSON)

How to use

  1. Paste TOML on the left, or click Load sample.
  2. Choose 2 or 4 spaces of indentation. The JSON appears as you type.
  3. If the TOML has a syntax error, such as a duplicate key or a missing value, the error shows the line where it fails.
  4. 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.

Related tools