TOML to JSON Converter (and JSON to TOML)
Data ToolsConvert TOML to JSON and back; Swap flips the direction and carries the result over.
Processed in your browser. A copy of each run is saved to your past runs so you can reopen it. Privacy
About
What the TOML to JSON Converter does
The TOML to JSON Converter reads TOML 1.0, the format of pyproject.toml, Cargo.toml and wrangler.toml, and writes the same data as JSON. The other direction writes TOML from a JSON object. Swap moves the result to the input and flips the direction. Errors give the line and column, and values TOML cannot hold, such as null, are named with their path.
Steps
How to use it
- 1Choose TOML → JSON or JSON → TOML.
- 2Paste the text or upload a file.
- 3Press Convert; use Swap to convert the result back.
Example
A real run
Input
[project] name = "weather-cli" version = "0.3.1" requires-python = ">=3.10" dependencies = ["httpx>=0.27", "rich>=13"] [project.scripts] weather = "weather_cli.main:app"
Output
{
"project": {
"name": "weather-cli",
"version": "0.3.1",
"requires-python": ">=3.10",
"dependencies": [
"httpx>=0.27",
"rich>=13"
],
"scripts": {
"weather": "weather_cli.main:app"
}
}
}The [project] table and its [project.scripts] subtable become nested objects, and the dependency array stays an array of strings.
Options
Every setting, and when to use it
- Direction and Swap
- Both directions live on one page. Swap puts the output into the input box and converts it the other way, a quick check that nothing was lost.
- JSON indent
- For TOML → JSON: 2 or 4 spaces for reading, or minified for embedding. TOML output always uses the standard layout of tables and key = value lines.
Good to know
Common problems and limits
Input up to 1 MB, TOML 1.0. TOML dates and times become ISO 8601 text in JSON, because JSON has no date type; the status line counts them.
JSON → TOML needs an object at the top level and refuses null, which TOML cannot represent; the error names the first null it finds, such as "tool.cache".
Comments in TOML are dropped, because JSON has none. For YAML files, use YAML to JSON instead.
Audience
Who uses it
- Python developersRead a pyproject.toml as JSON in a script or CI step, or check what a build tool will see in the [project] table.
- Rust developersInspect Cargo.toml dependencies and features as JSON, or generate TOML from data produced by another tool.
- Cloudflare Workers developersMove a wrangler.toml configuration to wrangler.json, or back, without retyping it.
FAQ
Frequently asked
What is TOML used for?
Configuration files that people edit by hand. Rust's Cargo.toml, Python's pyproject.toml, Cloudflare's wrangler.toml, Hugo sites and many CLI tools use it. TOML maps unambiguously to a hash table, which makes it easy to convert to JSON.
How do I convert wrangler.toml to wrangler.json?
Paste the wrangler.toml here and convert it; the JSON has the same keys, so it can be saved as wrangler.json. Recent versions of Wrangler also read wrangler.json and wrangler.jsonc. Check the result against Cloudflare's configuration docs, since comments in the TOML are not carried over.
Why can't null be written to TOML?
TOML has no null value: a key either has a value or is left out. Remove keys whose value is null, or replace null with an empty string or a default, before converting JSON to TOML. The error message names the key.
What happens to TOML dates?
TOML has native dates and times, such as released = 2026-11-02. JSON has no date type, so they become ISO 8601 strings like "2026-11-02". Converting back writes them as strings unless you remove the quotes.
TOML or YAML: which should I use?
TOML is explicit and hard to get wrong, which suits flat or moderately nested config. YAML is more compact for deeply nested data and lists of objects, and is the norm for Kubernetes and CI files. Use whatever your tool expects; JSON to YAML covers the YAML side.
Is my file sent anywhere?
No. Conversion happens in your browser with the open-source smol-toml library. A copy of each conversion is saved to your past runs so you can reopen it.
Automation: an MCP tool toml_to_json(toml), json_to_toml(json) and an n8n node are planned for this tool.