TOML ↔ JSON
Convert TOML to JSON or JSON to TOML. Auto mode tries JSON first and otherwise parses TOML. TOML date and time values become strings in JSON, and a JSON round trip does not preserve them as TOML date types.
About TOML ↔ JSON
TOML Convert translates between TOML and JSON in either direction — the config format of Cargo, pyproject.toml, and countless Rust and Python projects, converted to the format your tooling actually reads. Auto-detects which way you're going. Runs entirely in your browser.
- Category
- dev
- Input
- Accepts: text/plain, application/json or application/toml.
- Output
- Outputs: application/json.
- Cost
- Free, runs in your browser
- Memory
- low
Common uses
- Convert a pyproject.toml section to JSON for a script that reads JSON
- Turn a JSON config into TOML for a Rust project
- Inspect a gnarly TOML file as pretty-printed JSON
- Migrate config between tools that disagree on formats
- Validate that a TOML file parses before committing it
Frequently asked questions
How does auto-detection work?
The input is tried as JSON first; if that fails, it's parsed as TOML. You can also set the direction explicitly.
What happens to TOML dates?
TOML has native date/time values; JSON doesn't. They convert to ISO strings — stated plainly because it's the one lossy corner of the round trip.
Does it preserve comments?
No — comments aren't part of either format's data model, so they're lost in conversion. Keep the original file if its comments matter.
Is my config uploaded?
No. Conversion runs in your browser.
What about YAML?
Use JSON ⇄ YAML — chaining the two tools covers TOML→JSON→YAML.
Keywords
- toml
- json
- convert
- config
- configuration
- parse
- stringify
- developer