TOML → JSON

Parse TOML configuration into JSON.

Private by design. Your input never leaves this browser. Conversions run locally on your device.

What this tool handles

  • TOML dates and date-times become ISO 8601 strings.
  • Tables, inline tables and arrays of tables all become plain JSON objects and arrays.
  • Invalid TOML reports the line and column rather than a raw parser message.

Example

TOML

title = "FormatPort"

[owner]
name = "Ada"
active = true

JSON

{
  "title": "FormatPort",
  "owner": {
    "name": "Ada",
    "active": true
  }
}

When you would use it

  • Reading Cargo.toml from a script — A Rust project keeps its version and its dependency table in Cargo.toml, which jq and most CI helpers cannot read. As JSON, package.version and the whole dependencies table become ordinary object keys.
  • Pulling values out of pyproject.toml — Build metadata sits under [project] and tool sections such as [tool.ruff]. Those become nested objects, so a release script can read project.version without a TOML parser on the path.
  • Asserting on netlify.toml redirects — Each [[redirects]] block becomes one element of a redirects array, so a test can count them and check that every from has a matching to and status.
  • Piping config into a JSON-only tool — Setting indentation to compact prints the document on a single line, which is the shape to pipe into a command that expects one JSON value on stdin.

Common questions

How are TOML datetimes represented in JSON?

An offset date-time keeps its zone as 1979-05-27T07:32:00.000Z, a local date-time drops the trailing Z, a local date stays 1979-05-27 and a local time becomes 07:32:00.000. All four arrive as strings, because JSON has no date type of its own.

What happens to inf and nan?

JSON has neither, so inf, -inf and nan all come out as null.

Are hexadecimal, octal and binary integers preserved?

No. TOML accepts 0xDEADBEEF, 0o755 and 0b1010, but JSON has a single numeric type, so they are written in decimal — 0xDEADBEEF becomes 3735928559.

Why was my 64-bit integer refused?

TOML integers are 64-bit and JavaScript numbers are not. A value such as 9223372036854775807 cannot survive the trip, so the parse stops with "integer value cannot be represented losslessly" rather than quietly rounding it.

Related tools

  • JSON → TOML — Convert a JSON object to TOML.
  • Convert any format — Pick an input format and an output format and convert between any pair.
  • JSON → YAML — Convert JSON to readable YAML with configurable indentation.
  • YAML → JSON — Parse YAML and emit pretty-printed JSON.
  • JSON → CSV — Turn an array of objects into a CSV table.
  • CSV → JSON — Parse CSV or TSV into JSON, with delimiter detection and optional type coercion.

Browse all 25 tools