chain
T
TOML to JSON error
⌃⏎ run · clear · / focus input
// about this tool

TOML to JSON Online

Updated 2026-08-04

// how to use

  1. 1 Paste your TOML — a Cargo.toml, a pyproject.toml, a Netlify or Hugo config.
  2. 2 The JSON appears as you type, pretty-printed with 4-space indentation.
  3. 3 Copy it, or send it straight to another tool from the output panel.

// examples

A table
Input
[owner]
name = "Tom"
age = 30
Output
{ "owner": { "name": "Tom", "age": 30 } }
An array of tables
Input
[[servers]]
name = "alpha"

[[servers]]
name = "beta"
Output
{ "servers": [ { "name": "alpha" }, { "name": "beta" } ] }
Numbers with separators
Input
max_connections = 5_000
Output
{ "max_connections": 5000 }

// common uses

Reading a Cargo.toml or pyproject.toml from a script that only speaks JSON Feeding a TOML config into a tool, API or CI step that expects JSON Diffing two config files in a single format Checking that a hand-edited TOML file parses at all

// faq

Does this handle arrays of tables?
Yes. A repeated `[[servers]]` header becomes a JSON array of objects, which is the part hand-rolled converters most often get wrong. Inline tables, dotted keys, multi-line basic strings and underscore-separated numbers are all supported — it is a full TOML 1.0.0 parser, not a regex.
What happens to TOML dates?
Offset date-times, local date-times, dates and times are parsed as real date values and written into JSON as ISO-8601 strings, because JSON has no date type. `1979-05-27T07:32:00Z` comes out as `"1979-05-27T07:32:00.000Z"`.
Are comments preserved?
No, and no converter can preserve them. JSON has no comment syntax, so a TOML comment has nowhere to go. If the comments matter, keep the TOML file as the source of truth and generate the JSON from it.
Is my file uploaded anywhere?
No. The conversion runs in your browser — the TOML never leaves your machine. That matters here because config files routinely contain tokens, database URLs and deploy keys.
Can I go the other way?
Yes, use the JSON to TOML converter. Round-tripping is not always identical, because TOML has no null and JSON has no dates, but structure and values survive both directions.

Use this via API

Get a free API key →
curl -X POST https://thesnaptools.com/api/v1/tools/toml-to-json \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"toml":"[owner] name = \"Tom\" age = 30"}'
Esc
↑↓ navigate open Esc close