TOML to JSON Converter
Convert TOML to JSON locally in the browser, with no upload, so Cargo.toml and pyproject.toml configs holding secrets and infra details never touch a server.
What it does
- Locked to TOML to JSON, paste or drop and convert
- Handles arrays-of-tables and deeply nested tables
- Runs in-browser via Rust and WebAssembly, zero uploads
- Works offline once the page has loaded
Convert TOML to JSON directly in your browser, with no upload and no network round-trip. Most people who reach this tool have a config file (a Cargo.toml, a pyproject.toml, a Hugo or Netlify config, or app settings) and need it as JSON to feed a JSON-only API or parser, to inspect deeply nested tables in a familiar shape, or to migrate a config format. Because TOML configs routinely hold secrets, API keys, database strings, and internal infrastructure layout, the conversion runs entirely on your device so none of that is ever transmitted.
What this conversion actually does (and does NOT do)
TOML to JSON is a faithful data conversion with exactly one form of loss: JSON has no comment syntax, so every # comment in your TOML is discarded. The data converts perfectly, but the human documentation that explains it does not. If those comments matter, keep the TOML as your source of truth and treat the JSON as a generated artifact.
The other behaviors are about type translation. TOML has native first-class date and time types (RFC 3339, for example 2026-04-25T12:00:00Z), but JSON has no date type, so those values are emitted as ISO 8601 strings. Round-tripping the JSON back to TOML will not restore them as datetimes without manual retyping. TOML also permits non-finite floats (inf, -inf, nan), which standard JSON (RFC 8259) forbids, so a strict converter serializes them as null to keep the output valid. TOML integers and floats are explicitly typed and preserved as JSON numbers, and both basic and literal TOML strings become JSON strings with escaping normalized to JSON rules.
The structural mapping is the whole reason developers do this. TOML's arrays-of-tables ([[products]]) become a JSON array of objects, and dotted or nested table headers ([servers.alpha.database]) collapse into nested JSON objects that are far easier to traverse programmatically. Since this is text-to-text, there is no compression or quality loss. The JSON output is usually slightly larger than the TOML source because of the added braces, quotes, and commas, which is most noticeable on flat, section-heavy configs.
When to choose this conversion
Convert to JSON when a JSON-only tool, API, or parser needs your config, when you are debugging deeply nested settings and want a uniform object shape, or when you are migrating a config format. Do not convert if you need to keep comments or hand-editability, because those are precisely the reasons TOML exists. In that case keep TOML as the authoritative file and regenerate the JSON whenever the source changes. If you later need to go the other direction, the same YAML, JSON, and TOML converter handles JSON back to TOML.
How to convert
- Open this page, which is preset to the TOML to JSON direction (input format TOML, output format JSON).
- Paste your TOML, or drop a small
.tomlfile into the input. - Click convert. The JSON result appears in the output pane.
- Copy the JSON to your clipboard, or download it as a file.
No upload. It runs on your device.
This converter is compiled from Rust to WebAssembly and runs inside your browser tab. There are zero network requests for the conversion itself, so a Cargo.toml or pyproject.toml carrying embedded credentials, tokens, or internal infrastructure details never reaches a server. You can verify this yourself: open your browser DevTools, watch the Network tab, and convert a file. Nothing is sent. Because nothing is uploaded, there is nothing stored and nothing to delete, and once the page has loaded it keeps working offline, even on a plane.
No limits
No file-size cap, no sign-up, no watermark, no ads, and no trackers running alongside your config. Paste as much as you need, as often as you need.
Frequently asked questions
- Does converting TOML to JSON keep my comments?
- No. JSON has no comment syntax, so every
#comment in the TOML is discarded during conversion. The data itself converts faithfully, but the inline documentation does not, which is one reason to keep the TOML file as your source of truth. - Is my TOML file uploaded to a server?
- No. The conversion runs entirely in your browser through Rust compiled to WebAssembly, with zero network requests for the conversion. You can confirm this in your browser's DevTools Network tab while you convert.
- Can I convert a Cargo.toml or pyproject.toml to JSON?
- Yes. These are standard TOML files and convert the same as any other config. Because they often contain secrets or registry tokens, running the conversion locally means those values never leave your machine.
- How are TOML dates and datetimes represented in JSON?
- TOML has native RFC 3339 date and time types, but JSON has no date type, so they are emitted as ISO 8601 strings. If you convert the JSON back to TOML later, those values stay as strings unless you manually retype them as datetimes.
- What happens to TOML inf and nan values in JSON?
- TOML allows non-finite floats like
inf,-inf, andnan, but standard JSON (RFC 8259) forbids them. To keep the output valid, a strict converter serializes those values asnull. - How does TOML's array-of-tables convert to JSON?
- An array-of-tables such as
[[products]]maps to a JSON array of objects, one object per table entry. Dotted and nested table headers like[servers.alpha.database]collapse into nested JSON objects, which is exactly what makes deeply nested config easier to traverse in code. - Is TOML to JSON conversion lossless?
- The data is preserved faithfully, but the conversion is lossy in two specific ways: comments are dropped because JSON has none, and TOML datetimes become strings because JSON has no date type. If neither of those matters for your use, the result is effectively complete.
- Can I convert TOML to JSON offline or without internet?
- Yes. Once the page has loaded, the WebAssembly module runs locally, so conversion continues to work with no internet connection. This is useful when you are working with sensitive config on an isolated or air-gapped machine.
- Why would I convert TOML to JSON instead of keeping TOML?
- Convert when a JSON-only API, tool, or parser needs the config, when you are debugging deeply nested settings, or when you are migrating formats. If you instead need comments and hand-editability, keep TOML as the source of truth and treat JSON as a generated output.
- Will the JSON file be larger than my TOML file?
- Usually slightly larger. JSON adds braces, quotes, and commas that TOML does not require, so flat, section-heavy configs grow the most. There is no compression involved because this is a plain text-to-text conversion.
Related: convert the other direction with the YAML, JSON, and TOML converter, tidy the result with the JSON formatter, browse more text and data tools, or read why we process everything in the browser.