JSON ↔ TOML
Convert JSON to TOML and TOML back to JSON, locally.
Move config between JSON and TOML without losing structure
This tool converts a JSON document into TOML, the format used by Cargo.toml, pyproject.toml and similar config files, and converts TOML back into indented JSON. It's the tool to reach for when a project's config lives in TOML but you need to inspect or generate it from JSON, or the other way around. Config files rarely hold secrets on their own, but conversion still runs on plain JavaScript objects in your browser tab rather than an upload.
How to use the JSON ↔ TOML
- Paste JSON into the left panel, or click Example to load a sample document.
- Use the JSON → TOML and TOML → JSON toggle to pick the conversion direction.
- Read the converted result in the right panel; parse errors appear in the input panel's footer.
- Click the swap arrow between the panels to flip direction and continue editing the output.
- Copy the result or use the send-to menu to pass it into another tool.
TOML has no bare top-level array or scalar, only tables, so converting JSON to TOML requires an object at the root; a JSON array or primitive as the top-level value will fail to convert.
Nested JSON objects become TOML tables (`[section]`) and nested arrays of objects become arrays of tables (`[[section]]`), which is why deeply nested JSON can produce a TOML file with many bracketed headers.
Frequently asked questions
- Can I convert a JSON array to TOML?
- No, TOML requires an object at the document root, so a top-level JSON array or a bare value like a string or number will fail; wrap it in an object with a key first.
- How are nested objects represented in TOML?
- Each nested JSON object becomes a TOML table written as a bracketed section header, and arrays of objects become arrays of tables with double brackets, mirroring the JSON structure without flattening it.
- Does the converter preserve number and boolean types?
- Yes, JSON numbers and booleans map directly to TOML's native integer, float and boolean types rather than being converted to quoted strings, so round-tripping a document keeps its original types.
- Is my config file uploaded when I convert it?
- No, both directions run through a TOML parser and serializer executing locally in your browser tab, so config values, including any local paths or hostnames they contain, never leave your device.