Converters

TOML to JSON Converter

Convert TOML configuration into JSON, with dotted keys expanded and TOML datetimes rendered as ISO strings.

Private by design — your data never leaves your device.
✓ Free forever✓ No sign-up✓ No ads✓ Works offline once loaded

TOML to JSON Converter

Convert TOML configuration into JSON, with dotted keys expanded and TOML datetimes rendered as ISO strings.

Input

Your TOML

Nothing is uploaded.

Output

JSON output

Your result appears herePaste on the left and select “Convert to JSON”

TOML is written for people and JSON is read by programs, so this conversion is usually a step in a pipeline: a build script that needs to read pyproject.toml from a language with no TOML library, a tool that validates configuration against a JSON Schema, a template that interpolates values from Cargo.toml, or simply a check on what a file actually parses to when the table headers have got confusing.

The interesting parts of the conversion are the two places where TOML is richer than JSON. TOML has first-class date and time types, which JSON does not, and it has comments, which JSON also does not. Both are handled below. Parsing runs in a Web Worker in your browser, so a config file containing a database URL never leaves your machine.

How it works

How to use the toml to json

  1. 1

    Paste your TOML

    A Cargo.toml, a pyproject.toml, a Hugo or Netlify config, or an application settings file. Errors are reported with the parser's message so you can find the offending line — usually a mistyped table header or a value that needed quotes.

  2. 2

    Choose the JSON indentation

    Two spaces, four spaces or tabs for the output. This affects only how the JSON is printed, not the data.

  3. 3

    Check the dates and the nesting

    Look at how table headers became nested objects and how any date or time values were rendered, then copy or download the JSON.

How TOML structures arrive in JSON

  • Table headers become nested objects. A [server] section becomes a "server" object, and [server.tls] becomes a "tls" object inside it. The flat, readable header list turns into the tree it always represented.
  • Dotted keys become nesting too. A key written pool.size = 20 inside [database] produces "database": {"pool": {"size": 20}}. This catches people out: in TOML the dot inside a bare key is a structural path, not part of the name, so the JSON has an extra level you might not have expected.
  • Arrays of tables become arrays of objects. Repeated [[rate-limit]] blocks become a "rate-limit" array with one object per block, in document order.
  • Integers and floats are distinguished by TOML and merged by JSON. TOML's 8080 is an integer and 0.05 is a float; JSON has one number type, so the distinction exists in the source and not in the output. Underscore separators in numeric literals, as in 1_048_576, are stripped during parsing and the plain value appears in the JSON.
  • All three string forms collapse to one. Basic strings, literal single-quoted strings and multi-line triple-quoted strings all become ordinary JSON strings; the newlines in a multi-line block become \n escapes. Which syntax produced the string is not recorded.
  • Hyphenated keys stay hyphenated. per-minute becomes the JSON key "per-minute", which is valid JSON but awkward to access with dot notation in JavaScript. Bracket access or a rename on your side handles it.

Dates and times: the real mismatch

TOML defines four temporal types and treats them as first-class values, which is one of the reasons it exists. An offset date-time 2026-03-11T09:14:02Z, a local date-time without an offset, a local date 2026-06-01, and a local time 22:00:00 are all distinct types in the data model, and a TOML parser hands them to your application as date objects rather than text.

JSON has no date type whatsoever. So every one of these becomes a string in the output, in ISO 8601 form. That is the only representation available, and it is what every JSON API does with timestamps too.

The subtlety worth checking is the offset-less types. A TOML local date deliberately carries no timezone — 2026-06-01 means that calendar day wherever you are, which is the right model for a renewal date or a contract term. Rendering it as an ISO string can attach a UTC representation that implies a precision the original value did not have. If your consumer is timezone-sensitive, inspect those fields in the output and decide whether you want the bare date string instead.

The reverse direction is worse: convert this JSON back to TOML and your dates return as quoted strings, not as TOML datetimes, because by then they are indistinguishable from any other text. Date typing is a one-way loss across this boundary.

Comments, ordering and numeric range

Every # comment is discarded, because JSON has no comment syntax. In a configuration file the comments frequently carry the reasoning — why a pool size is 20, who owns the file, what breaks if a flag is flipped — so keep the TOML as your source of truth and treat the JSON as a generated artefact.

Key order within a table is preserved as written in practice, and arrays of tables keep their document order. But TOML explicitly does not consider key order meaningful, and neither does JSON, so do not build anything that depends on it.

One numeric edge to be aware of: TOML specifies 64-bit signed integers, while JSON numbers are IEEE-754 doubles in every mainstream implementation. Integers beyond roughly nine quadrillion cannot be represented exactly, so a very large identifier written as a TOML integer may not survive the trip with all its digits intact. If you have such values, store them as quoted strings in the TOML.

Everything runs client-side in a Web Worker. Nothing is uploaded, which is the usual consideration when the file you are pasting contains a connection string.

Common questions

TOML to JSON FAQ

Why does my dotted key produce nested objects?

Because in TOML a dot inside a bare key is a path separator, not part of the name. pool.size = 20 defines size inside a pool table. If you actually wanted a key containing a dot, it must be quoted in the TOML as "pool.size".

What happens to TOML dates?

They become ISO 8601 strings, because JSON has no date type. Check offset-less local dates and times in particular, since the string form can imply a timezone the original value did not carry.

Are my comments preserved?

No. JSON has no comment syntax, so every # line is dropped. Regenerate the JSON from the TOML whenever it changes rather than editing the JSON and converting back.

What does [[table]] convert to?

An array of objects. Each [[name]] block becomes one element of the array called name, in the order the blocks appear in the file.

Which TOML version is supported?

TOML 1.0, including arrays of tables, dotted keys, inline tables, all four datetime types, numeric underscore separators, and heterogeneous arrays.