TOML to JSON Converter

Paste TOML and get clean JSON as you type, with the exact line and column of any error. Tables become objects, arrays of tables become lists, and 64-bit integers keep every digit. It runs in your browser, so nothing is uploaded.

Round-trip
Valid TOMLSample converted to JSON.
19 → 37 lines

Converts as you type. Ctrl/⌘+Enter converts now,Ctrl/⌘+Shift+C copies the JSON.

  • Private by designRuns in this tab. No upload, no server code.
  • Full TOML 1.1Inline tables over many lines, trailing commas, new escapes.
  • Exact 64-bit integers9223372036854775807 stays 9223372036854775807.
  • Errors you can fixLine, column and the broken line, one click away.

Example: a Cargo.toml in TOML and JSON

Cargo.toml
[package]
name = "hello"
version = "0.3.1"

[[bin]]
name = "hello"
path = "src/main.rs"

[[bin]]
name = "hello-admin"
path = "src/admin.rs"
Cargo.json
{
  "package": {
    "name": "hello",
    "version": "0.3.1"
  },
  "bin": [
    {
      "name": "hello",
      "path": "src/main.rs"
    },
    {
      "name": "hello-admin",
      "path": "src/admin.rs"
    }
  ]
}
The [package] table becomes a package object, and the two[[bin]] blocks become one bin list with two objects, in the order they appear.

How TOML types map to JSON

Every TOML value has a JSON counterpart, so the structure carries over in full. What changes is detail: JSON has one number type and no date type, so those values are written in the closest JSON form.

Each TOML type and the JSON value the converter writes.
TOMLJSONExample output
table [server]object"server": { … }
array of tables [[bin]]array of objects"bin": [{ … }, { … }]
inline tableobject{ "x": 1 }
arrayarray[80, 443]
string (basic, literal, multi-line)string"hello"
integer (also hex, octal, binary)number0xff → 255
64-bit integerexact number9223372036854775807
floatnumber1.0 → 1
inf, nanstring or null (your choice)"Infinity"
booleanbooleantrue
date-time, date, timeISO 8601 string"1979-05-27"

How are TOML arrays of tables converted to JSON?

Each [[name]] header starts a new object, and all objects with the same name are collected into one JSON array called name. Keys under a header belong to the most recent object, so a file with three [[bin]] blocks gives an array of three objects.

Why does 1.0 become 1 in JSON?

JSON has a single number type, so 1.0 and 1 are the same value once converted. The number is unchanged; only the TOML hint that it was a float is lost. If the difference matters, keep the TOML file as the source of truth.

How TOML dates and times appear in JSON

TOML has four date and time types. JSON has none, so each becomes an ISO 8601 string.

The four TOML date and time types and their JSON strings.
TOML typeTOMLJSON string
offset date-time1979-05-27T07:32:00-08:00"1979-05-27T07:32:00-08:00"
local date-time1979-05-27T07:32:00"1979-05-27T07:32:00"
local date1979-05-27"1979-05-27"
local time07:32:00"07:32:00"

Does the converter keep the time zone offset?

Yes. An offset such as -08:00 is written exactly as it appears, never shifted to UTC. Fractions of a second are kept to the millisecond, so 00:32:00.999999 becomes00:32:00.999.

Fixing TOML errors

When the TOML is invalid, the converter names the problem, gives its line and column, marks the line in the editor and shows the broken lines underneath. The most common causes are:

  • The same key or table twice. TOML does not allow a value to be redefined.
  • Missing quotes. Text values need "double" or 'single' quotes.
  • Spaces in bare keys. Write "my key" = 1, not my key = 1.
  • An unclosed array or string, often a missing ] or " at the end of a line.
broken.toml
[server]
port = 8080

[server]
host = "0.0.0.0"
message shown
Invalid TOML document: trying to redefine an already defined table or value
Line 4, column 2
Two [server] headers define the same table twice. Merge them into one block to fix it.

What does "trying to redefine an already defined table" mean?

A table header or key appears a second time. In the example above, [server] is opened twice. Move host under the first [server] and delete the second header.

Which TOML version does the converter support?

TOML 1.1.0, released in December 2025, and every file written for TOML 1.0. Version 1.1 adds inline tables that span several lines, trailing commas in inline tables, times without seconds such as07:32, and the \x and \e string escapes.

Where you convert TOML to JSON

Converting TOML to JSON usually means feeding a config file to a tool that only reads JSON:

  • Cargo.tomlRead Rust package data in JavaScript tooling
  • pyproject.tomlPass Python project settings to JSON-only CI steps
  • hugo.tomlMove a Hugo site config to JSON
  • wrangler.tomlMigrate Cloudflare Workers config to wrangler.jsonc
  • netlify.tomlInspect build and redirect rules as data

TOML vs JSON

TOML and JSON compared on comments, types and readability.
FeatureTOMLJSON
CommentsYes, with #No
Date and time typeYes, four typesNo, strings only
Integer vs floatSeparate typesOne number type
NullNoYes
Deep nestingDotted table headersBraces at every level
Typical useHand-edited config filesAPIs and data exchange

What is lost when converting TOML to JSON?

Comments, the difference between integers and floats, and the date types, which become strings. The data itself is kept in full. Values JSON cannot hold, inf and nan, are listed as warnings so nothing changes silently.

How do I convert JSON back to TOML?

Use the JSON to TOML converter. The Round-trip button above opens your JSON there in one click.

Is your TOML private?

Yes. The conversion runs as JavaScript in your browser tab. The site has no server code, and its security policy blocks the page from sending data anywhere. Your last input is kept only in this browser so it is still there when you come back; Clear removes it.

Is my TOML file uploaded anywhere?

No. Opening a file reads it on your device. You can check this in your browser's network panel: converting makes no requests.