Skip to content

TOML to JSON Converter

Turn Cargo.toml, pyproject.toml and other TOML configs into exact JSON.

Output
Runs in your browser — your data is not uploaded.

Parses TOML 1.1.0 (smol-toml 1.9.0). Integers keep full 64-bit precision.

How to use

  1. Click Paste to load TOML from your clipboard, or Upload to choose a .toml or .txt file.
  2. Under Output, choose Indent 2, Indent 4 or Minify.
  3. Set Dates and times to Reject, or choose Convert to strings to allow TOML dates and times.
  4. Check the automatically updated result; for large inputs, click Convert when it appears.
  5. Click Copy to copy the JSON or Download to save it as a file.

Examples

Cargo.toml package and dependencies

Input
[package]
name = "inventory-api"
version = "0.1.0"
edition = "2021"

[dependencies]
serde = { version = "1.0", features = ["derive"] }
tokio = { version = "1", features = ["full"] }
Output
{
  "package": {
    "name": "inventory-api",
    "version": "0.1.0",
    "edition": "2021"
  },
  "dependencies": {
    "serde": {
      "version": "1.0",
      "features": [
        "derive"
      ]
    },
    "tokio": {
      "version": "1",
      "features": [
        "full"
      ]
    }
  }
}

Product records as minified JSON

Input
[[products]]
name = "Claw hammer"
sku = 738594937
price = 19.95

[[products]]
name = "Box of nails"
sku = 738594938
price = 4.50
Output
{"products":[{"name":"Claw hammer","sku":738594937,"price":19.95},{"name":"Box of nails","sku":738594938,"price":4.5}]}

Schedule with dates and a UTC offset

Input
[schedule]
starts_at = 2026-10-05T09:30:00-04:00
deadline = 2026-10-09
opens_at = 08:00
local_reminder = 2026-10-08T16:30:00
Output
{
    "schedule": {
        "starts_at": "2026-10-05T09:30:00.000-04:00",
        "deadline": "2026-10-09",
        "opens_at": "08:00:00.000",
        "local_reminder": "2026-10-08T16:30:00.000"
    }
}

How TOML types become JSON

TOMLJSON
String (basic, literal, multi-line)string
Integer (42, 0xDEADBEEF, 1_000)number, exact (64-bit and larger)
Float (1.0, 6.02e23)number, keeps .0
inf, nanerror — JSON has no infinity
Booleanboolean
Array, table, inline table, array of tablesarray, object
Date, time, date-timeerror by default, or an ISO 8601 string

FAQ

Which TOML version is supported?

The tool parses TOML 1.1.0 with smol-toml 1.9.0 and also accepts TOML 1.0 files. Supported 1.1 features include multiline inline tables with trailing commas, the \e escape and times without seconds.

Does converting TOML to JSON preserve large integers?

Integers are written digit for digit, so 9223372036854775807 stays exact in the JSON text. Hexadecimal, octal and binary integers become decimal numbers.

Why won't my TOML convert to JSON?

Duplicate keys, redefined tables and syntax errors stop conversion and show a line and column. Values such as inf, nan and overflowing floats such as 1e400 also fail because JSON cannot represent them; use a string or a finite number instead.

Is my TOML file uploaded or saved?

Conversion runs in your browser, and the tool does not upload your TOML or JSON. The input is not saved; option settings are stored in localStorage. Google Analytics receives tool events, but not your TOML or JSON.

What is the file size limit?

Files larger than 10 MB are rejected, as are binary and non-UTF-8 files. Pasted text has no explicit size limit, but your browser's available memory can limit processing.