TOML to JSON
ConverterParse a TOML document into JSON with tables, arrays, dates and multiline strings for inspecting, debugging and migrating project configuration files safely.
Related Tools
About TOML to JSON
When you need to read TOML config in code, or feed the content of Cargo.toml or pyproject.toml to a JSON-only API, you need a TOML→JSON conversion. This tool parses the full TOML grammar — tables, arrays of tables, inline tables, and date-times — locally in your browser and outputs standard JSON, reporting parse failures clearly with a location hint. Two mapping details to remember: native TOML date-times become ISO 8601 JSON strings, since JSON has no dedicated date type, and duplicate keys are rejected per the spec, so the error guides you to the conflict. For example, [server] with host = localhost and port = 8080 outputs {"server":{"host":"localhost","port":8080}}, directly usable for config migration. Inline tables are expanded into plain objects with unchanged semantics, and everything runs on your machine — nothing is uploaded, which makes it safe for project config that may contain repository-relative paths or local settings.
How to Use
- Open the TOML to JSON tool
- Select the source and target formats
- Adjust the output options as needed
- Click the Convert button; results appear in real time
- Copy or export the result
Use Cases
- Read project metadata — Convert pyproject.toml / Cargo.toml to JSON to extract version, dependencies, etc. via script.
- Feed configs to APIs — Convert TOML to JSON to submit via REST to services that only accept JSON.
- Display configs in frontend — Browsers cannot parse TOML natively; convert to JSON for direct rendering.
- Check types — See how TOML dates, integers, and floats map to JSON types to debug type issues.
- Diff configs — Convert two TOML files to JSON, then use the JSON Diff tool to compare.
- Validate schema — Convert TOML to JSON then feed the result into a JSON Schema validator for config validation.
- CI pipeline variables — Transform a TOML-based local config into JSON for injection into a CI/CD environment block.
FAQ
What do TOML dates become?
Native TOML date-times become ISO 8601 JSON strings, since JSON has no dedicated date type.
How do arrays of tables [[x]] map?
They map to JSON object arrays, i.e. "x": [ {.}, {.} ] — as you would expect.
Does it support all TOML 1.0 features?
It supports mainstream features: inline tables, arrays of tables, multi-line strings, all scalars. Rare edge syntax may need manual tweaks.
Why a duplicate-key error?
TOML forbids redefining a key within the same table. The error points to the conflict — remove the duplicate.
Are inline tables preserved?
An inline table like { a = 1 } is expanded into a plain JSON object {"a":1}; the notation differs but the semantics are identical.
Can I convert to YAML?
Yes, use our TOML to YAML tool.