TOML to JSON Converter

Convert TOML to JSON and JSON to TOML instantly. Supports tables, arrays, inline tables, and all TOML data types. Free, browser-based, no upload required.

  • Runs in your browser
  • Your data never leaves your browser
  • Free · No Sign-Up
Clears both panes, the status and pending conversion. Ctrl+L (⌘+L on Mac) does the same while focus is inside this tool.
Paste TOML here. After 0.3 seconds without typing, the JSON pane updates with two-space indentation. Values JSON cannot preserve stop conversion; the status names the affected fields.
Copies all current text in the TOML pane, including your edits. An empty pane cannot be copied.
Paste a JSON object here. After 0.3 seconds without typing, the TOML pane updates. Null values and numbers that cannot be preserved stop conversion.
Copies all current text in the JSON pane, including your edits. An empty pane cannot be copied.
Examples, details and FAQ Worked examples, how it compares with other tools, and answers to common questions.

Worked Examples

Simple table

Input TOML:

[database]
host = “localhost”
port = 5432
enabled = true

Output JSON: { "database": { "host": "localhost", "port": 5432, "enabled": true } }, indented with two spaces.

Array of tables

Two [[fruits]] entries become one array, and each entry keeps only the keys it has:

[[fruits]]
name = "apple"

[[fruits]]
name = "banana"
color = "yellow"
{
  "fruits": [
    { "name": "apple" },
    { "name": "banana", "color": "yellow" }
  ]
}

(The tool indents every object over several lines; it is shortened here.) A pyproject.toml works the same way: [tool.ruff.lint] becomes "tool": { "ruff": { "lint": { ... } } }, and keys with dashes such as requires-python are kept as written.

JSON to TOML: a package.json

Pasting this JSON into the right panel:

{"name":"demo","version":"1.0.0","private":true,"scripts":{"build":"astro build","test":"node --test"},"workspaces":["packages/*"],"engines":{"node":">=22"}}

gives:

name = "demo"
version = "1.0.0"
private = true
workspaces = [ "packages/*" ]

[scripts]
build = "astro build"
test = "node --test"

[engines]
node = ">=22"

Plain values are written first and nested objects follow as [tables], because in TOML every key after a table header belongs to that table. Keys that are not bare words are quoted: {"my key": 1, "a.b": 2} becomes "my key" = 1 and "a.b" = 2, so a dot inside a JSON key is not turned into nesting.

TOML vs JSON

TOML (Tom’s Obvious Minimal Language) is a configuration file format designed to be easy to read due to its obvious semantics. It is widely used in Rust projects (Cargo.toml), Hugo, and many other tools. JSON is the standard data interchange format for APIs and web services. This tool converts between them; the differences between the two type systems are listed under “What Changes in Conversion” below.

What Changes in Conversion

TOML has types that JSON lacks, and the reverse. This input:

# build settings
title = "x"
created = 2026-09-29T10:00:00Z
day = 2026-09-29

[server]
port = 8080

converts to:

{
  "title": "x",
  "created": "2026-09-29T10:00:00.000Z",
  "day": "2026-09-29",
  "server": {
    "port": 8080
  }
}
  • Comments are dropped. JSON has no comments.

  • Dates and times become strings. An offset date-time gains milliseconds (.000Z). Converting the JSON back gives a quoted string, not a TOML date.

  • Times finer than milliseconds stop the conversion to JSON. The TOML parser keeps milliseconds and drops further digits, which TOML 1.0 allows a parser to do. started = 2026-10-01T09:30:00.123456Z in a [build] table gives Not converted: JSON cannot hold these values without changing them: /build/started: 2026-10-01T09:30:00.123456Z has more than millisecond precision. Trailing zeros, as in .120000, lose nothing and convert. Dates and times inside strings and comments are text and are not checked.

  • inf and nan stop the conversion to JSON. JSON has no infinity or NaN, and JSON.stringify would write null. This TOML:

    ratio = inf
    
    [limits]
    max = nan

    gives Not converted: JSON cannot hold these values without changing them: /ratio: inf has no JSON form (JSON.stringify would write null); /limits/max: nan has no JSON form (JSON.stringify would write null).

  • Integers outside ±(2^53 − 1) stop the conversion in both directions. TOML 1.0 allows 64-bit integers, but the TOML parser stops with integer value cannot be represented losslessly rather than round them. In JSON → TOML, JSON.parse would round them, so the field is listed instead; a number too large for a double, such as 1e400, is listed too.

  • JSON null stops the conversion to TOML. TOML has no null. This JSON:

    {"user":{"id":9007199254740993,"nickname":null}}

    gives Not converted: TOML cannot hold these values without changing them: /user/id: integer 9007199254740993 is outside ±(2^53 − 1), so JavaScript would round it; /user/nickname: null — TOML has no null. Quote large IDs as strings and replace or remove nulls, then convert again.

  • A failed conversion clears the output panel and disables its Copy button, so an earlier result is not copied by mistake.

  • -0.0 keeps its sign both ways. The JSON {"offset":-0.0} gives offset = -0.0, a TOML float, and TOML offset = -0.0 gives "offset": -0.0 (JSON.stringify alone would write 0). The JSON integer -0 gives count = 0 for {"count":-0}: TOML 1.0 says -0 and +0 are the same integer as 0.

  • JSON 1.0 becomes TOML 1. JSON.parse does not keep the difference between 1.0 and 1, so a float that happens to be whole is written as a TOML integer. Write 1.5-style values or fix the type by hand if your program checks it.

  • The JSON root must be an object. [1, 2] gives stringify can only be called with an object, because a TOML document is always a table.

  • Redefinitions are errors. TOML such as a = 1 followed by [a] gives trying to redefine an already defined table or value with the line and a caret.

For the same data in YAML, use the YAML ↔ TOML converter; to check a JSON file before converting it, use the JSON formatter.

FAQ

What TOML features are supported?

All standard TOML v1.0 features are supported via the smol-toml library: tables, arrays of tables, inline tables, dotted keys, multi-line strings, integers, floats, booleans, datetimes, and arrays.

Can JSON arrays of objects be converted to TOML?

Yes. JSON arrays of objects become TOML arrays of tables ([[table.name]] syntax). Primitive arrays become TOML inline arrays.

What happens to JSON null values?

TOML does not have a null type, so the conversion stops and lists each null field by its path (for example /user/nickname). Replace or remove the nulls and convert again.

Is my data sent anywhere?

No. All conversion runs in your browser. Your data never leaves your machine.