TOML to JSON Converter
Convert TOML to JSON. Handles TOML tables, arrays, array-of-tables, inline tables, and native TOML dates/datetimes (converted to ISO 8601 strings). Runs entirely in your browser.
Input
Options
Output
Guides
Paste TOML, get JSON. This free online TOML to JSON converter turns a Cargo.toml, pyproject.toml, .hugo.toml or any other spec-compliant TOML document into clean, ready-to-use JSON — the format nearly every API, JavaScript app and config-consuming script expects. Conversion happens as you type, with no upload and no sign-up.
How to use it
- Paste your TOML into the input box, or upload a
.tomlfile with the uploader — its contents drop straight into the editor. - Pick an indent size (2 spaces, 4 spaces, tab, or minified) from the Options section.
- The JSON output appears instantly on the right, syntax-highlighted.
- Copy it, or download it as a
.jsonfile.
TOML [tables] and dotted [parent.child] paths become nested JSON objects, [[array-of-tables]] blocks become JSON arrays of objects, and inline tables/arrays convert directly to their JSON equivalents. TOML integers and floats become JSON numbers, and booleans and strings pass straight through.
How are TOML dates handled?
TOML has native date and time types — offset date-time (1979-05-27T07:32:00-08:00), local date-time, local date (2024-01-15) and local time — but JSON has no date type at all. This converter represents every TOML date as its ISO 8601 string form: an offset date-time keeps its original offset rather than being normalized to UTC, and a bare local date stays a plain YYYY-MM-DD string. That's the same representation Date.prototype.toJSON() produces, so the output is what every JSON-based tool already expects when it sees a date-like string.
What if my TOML is invalid?
The converter parses with a strict, spec-compliant TOML 1.0 reader and reports a clear error — including the exact line and column — instead of guessing at malformed input or silently producing garbage JSON. Fix the line it points to and the output regenerates automatically.
Does it handle nested tables and arrays correctly?
Yes. Tables and dotted table paths ([database.credentials]) become correctly nested JSON objects, and [[array-of-tables]] — TOML's syntax for a repeated table-shaped record like a list of dependencies or servers — becomes a JSON array of objects in document order. Inline tables ({ x = 1, y = 2 }) and inline arrays convert the same way whether they appear at the top level or nested several tables deep.
Is my data private?
Completely. The conversion runs in your browser using smol-toml, a small, spec-compliant, pure-JavaScript TOML 1.0 library. Your TOML is never sent to a server, never logged and never stored — safe for config files containing hostnames, credentials or other details you'd rather not upload anywhere.
Why convert TOML to JSON at all?
TOML is a great fit for hand-edited config files — comments, clear typing, readable tables — but most programmatic consumers (JavaScript tooling, REST APIs, log pipelines, jq) speak JSON, not TOML. This converter is the bridge: take a config file written for humans and turn it into the format the rest of your stack can actually parse.