Tools / Text & Data / JSON to TOML Converter
Client-side

JSON to TOML Converter

Turn a JSON object or API response into clean, hand-editable TOML for Cargo.toml, pyproject.toml, or Hugo and Netlify config, locally in the browser with nothing uploaded.

What it does

  • Locked to JSON in, TOML out: paste and convert
  • Maps JSON objects to TOML tables and arrays of objects to [[tables]]
  • Omits JSON null keys, since TOML has no null type
  • Runs locally, config with secrets never leaves the tab

Convert JSON to TOML directly in your browser, with nothing uploaded to a server. Most people reach this tool to turn an existing JSON config, a package.json, or an API response into TOML they will then hand-edit, usually a Cargo.toml, a pyproject.toml, or a Hugo, Netlify, or other static-site config. You want clean, valid, copy-pasteable TOML rather than a download, and because that config often holds API keys, connection strings, or internal hostnames, the conversion happens entirely on your device.

What this conversion actually does (and does NOT do)

JSON to TOML is a one-directional narrowing of format richness, not a symmetric round trip. Every JSON value maps cleanly into TOML: objects become TOML tables written as [table], arrays of objects become arrays of tables written with the double-bracket [[table]] syntax (a construct with no JSON visual analog), and strings, numbers, and booleans carry over directly. The data model survives, but TOML can express things JSON cannot, so going back is lossy.

The single biggest correctness pitfall is null. JSON has a null value; TOML has no null type at all. The correct behavior, and what this tool does, is to omit the key entirely rather than emit an empty string or a placeholder, which is what some converters do silently and which breaks downstream parsing. Watch for it: if a key vanishes from your output, it held null in the source.

Depth is the other thing to plan for. TOML is comfortable at roughly two to three levels of nesting; beyond that you get long [a.b.c.d.e] table headers, and the indentation-based depth cue from JSON is gone because the dotted header path becomes the only depth indicator. This is a text and config transformation, so there is no file-size delta or quality-loss axis to worry about. The meaningful axis here is structural fidelity: nulls, nesting depth, and datetime typing. TOML has first-class date and time types, but JSON does not, so any JSON date string stays a plain string. TOML cannot also express anchors or references, so a value that repeats in your JSON is written out verbatim each time. Comments cannot be carried over because JSON has none, but adding comments to the TOML output by hand afterward is usually the whole point of converting.

When to choose JSON to TOML

Choose this direction when the destination is a human-edited config file and you want the readability of named sections with equals-sign assignments. TOML shines for shallow, well-named configuration like a Cargo.toml or pyproject.toml. If your data is deeply nested, an API payload, or meant for machine exchange, keep it as JSON or consider converting JSON to YAML instead, since YAML tolerates deep nesting more gracefully. If you ever need to go the other way, the TOML to JSON converter handles the reverse.

How to convert

  1. Open this page, which is pre-set to JSON as input and TOML as output.
  2. Paste your JSON into the source pane (a package.json, an API response, or any JSON config).
  3. Click convert to produce the TOML.
  4. Review the result for omitted null keys and any deep table headers.
  5. Copy the TOML to your clipboard or download it as a file.

No upload. It runs on your device.

The conversion is performed by a Rust module compiled to WebAssembly that runs inside your browser tab. There are zero network requests for the conversion itself, it works offline once the page has loaded, and there is nothing to delete afterward because nothing was ever uploaded. You can verify this yourself: open your browser DevTools, watch the Network tab, and convert, no request carries your data out. That matters here because config files routinely hold secrets and credentials such as API keys, database connection strings, and internal hostnames, and those should never be pasted into a server-side tool that might log them.

No limits

Convert as much JSON as you like. No file-size cap, no document-count limit, no watermark, no sign-up, and no ads.

Frequently asked questions

What happens to JSON null values when converting to TOML?
TOML has no null type, so a JSON null has no direct equivalent. This tool omits the key entirely, which is the correct TOML behavior, rather than emitting an empty string or a placeholder that would break parsing downstream. If a key disappears from your output, it held a null value in the source.
Can I convert deeply nested JSON to TOML?
Yes, but TOML is most readable at about two to three levels of nesting. Beyond that the output uses long dotted table headers like [a.b.c.d], and the indentation depth cue from JSON is replaced by that dotted path, which can get hard to read. For very deep structures, JSON or YAML usually stays cleaner.
Does JSON to TOML conversion lose any data?
The JSON data values all map into TOML, so no values are silently discarded except nulls, which are intentionally omitted because TOML cannot represent them. The conversion is one-directional in richness: TOML can express types and constructs JSON cannot, so converting back is not a guaranteed round trip.
How are JSON arrays of objects represented in TOML?
An array of objects becomes a TOML array of tables, written with double-bracket headers like [[table]] repeated once per element. This is a TOML-specific construct with no direct visual analog in JSON, so the output structure will look different from the bracketed array in your source.
Can I convert a package.json into a Cargo.toml or pyproject.toml?
You can convert the JSON structure into valid TOML, which gives you a head start, but a package.json does not share field names with Cargo.toml or pyproject.toml. Treat the output as scaffolding you then rename and hand-edit into the target manifest's expected keys.
Is my JSON uploaded to a server when I convert it?
No. The conversion runs entirely in your browser through a Rust-to-WebAssembly module, with no network request carrying your data. You can confirm this in your browser DevTools Network tab while you convert.
How do I convert JSON to TOML without uploading my data?
This page is that workflow: paste your JSON, convert, and copy the TOML, all locally. Because nothing leaves the tab, it is safe for config that contains API keys, connection strings, or internal hostnames.
Can I convert JSON to TOML offline?
Yes. Once the page has finished loading, the WebAssembly converter works without any network connection. You can disconnect and keep converting, since the logic already lives in your browser.
Are JSON date strings converted to TOML datetime types?
No. TOML has first-class date and time types, but JSON does not, so a date written as a JSON string stays a plain string in the TOML output. The converter cannot reliably infer that a string was meant to be a datetime, so you would type it by hand if you need a real TOML datetime.
Why would I convert JSON to TOML instead of keeping JSON?
TOML is designed for human-edited configuration, with named sections and equals-sign assignments that read more clearly than nested braces for shallow config. The usual reason to convert is to produce a config file you will then comment and maintain by hand, something JSON does not support since it has no comments.

Related tools: convert the other way with the TOML to JSON converter, switch to JSON to YAML for deeply nested data, or clean up your source first in the JSON formatter. See all text and data utilities on the text tools hub.