TOML to JSON Converter
Drop a TOML config (Cargo.toml, pyproject.toml, Hugo's config.toml), get clean JSON ready to feed to jq, a script, or an API. Tables, arrays-of-tables, and inline tables all preserved.
Drop your TOML file here
Converts to .json — stays on your device
Why convert TOML to JSON?
- Piping Cargo.toml metadata into a script that expects JSON — no need for a TOML library in the script.
- Extracting build settings from pyproject.toml in a CI step that already speaks JSON.
- Migrating a Hugo or Zola site's config.toml into a JSON-based static site generator.
- Feeding a TOML config into jq or yq for one-off querying without installing a TOML CLI.
- Producing JSON snapshots of TOML configs for diffing in a tooling pipeline that prefers JSON.
- Bridging a Rust ecosystem TOML config into a JavaScript or Go service that wants JSON.
How our converter works
Your TOML is parsed by smol-toml, a strict TOML 1.0 parser, into a JavaScript object — tables become nested objects, arrays of tables become arrays of objects, dates and times are preserved as ISO strings. The object is then serialized to JSON with 2-space indentation. Comments are dropped (JSON doesn't support them) and key order is preserved. Everything runs in your browser; configs with secrets or API keys never leave your device.
TOML vs JSON — when to use which
| Feature | TOML | JSON |
|---|---|---|
| Comments | Yes (#) | No |
| Primary use | Configs (Cargo, pyproject, Hugo) | APIs, data interchange |
| Readability | Indented sections, very scannable | Dense, punctuation-heavy |
| Date/time types | First-class | ISO strings only |
| Nested objects | Tables and dotted keys | Curly-brace nesting |
Frequently asked questions
Are comments preserved?
No — JSON has no comment syntax, so they're dropped. If comments matter for your workflow, keep the TOML as the source of truth and only generate JSON for tools that need it.
What about TOML datetimes?
Local dates, times, and offset datetimes are emitted as ISO 8601 strings in the JSON output. Round-tripping back through json-to-toml restores them as TOML datetime literals.
Are arrays-of-tables supported?
Yes — TOML's [[users]] syntax becomes a JSON array of objects. Nested tables and inline tables work identically.
Are my files uploaded?
No. Conversion runs entirely in your browser. Configs containing secrets, signing keys, or internal schemas stay on your device.
Why am I getting a parse error?
The parser is strict TOML 1.0 — common gotchas are mixing tab and space indentation, using quotes around bare keys that don't need them, or trailing commas (allowed in arrays, not in inline tables). The error message points to the line.
About the TOML format
TOML (Tom's Obvious, Minimal Language) is the config format for the Rust and Python tooling ecosystems — Cargo, pyproject, Black, Ruff, and most modern CLI tools default to it. Its design goal is reviewability for humans: visual sections, comment support, and a strict typing model that makes parsing unambiguous. JSON, by contrast, is the data-interchange format every API speaks. Converting TOML → JSON is what you do when you need to feed a TOML config into a tool that doesn't read TOML — jq is the most common case, but any script-based pipeline that already handles JSON benefits.