JSON ↔ TOML Converter
Convert JSON to TOML or TOML back to JSON for config files like Cargo.toml and pyproject.toml. Readable, copyable output generated in your browser.
Input
Stays in your browserOutput
Shortcuts: Ctrl+Enter run · Ctrl+Shift+C copy result · / search (use ⌘ on Mac)
Next steps
Done here? Use the Send to… menu on the result to carry it on to JSON Parser or JSON ↔ YAML Converter.
Online JSON to TOML Converter
Convert common configuration data between JSON and TOML without uploading it or installing a local package. It is useful when a project moves configuration between JavaScript tooling that prefers JSON and applications that prefer readable TOML.
What this converter does and who uses it
JSON and TOML both describe structured configuration, but TOML favors readable [section] tables over JSON's nested braces. Two concrete uses: a Node.js project moving a config file to a TOML-based tool (like a Rust or Python service) that doesn't read JSON, and a developer who finds a JSON API response easier to review as TOML while writing documentation or a support ticket.
Worked example
Converting {"app": "DevStackKit", "port": 3000, "features": ["json", "toml"]} to TOML produces app = "DevStackKit", port = 3000, and features = ["json", "toml"] on their own lines — strings, numbers, and arrays of primitives all convert directly. A nested object instead becomes a [section] table: {"server": {"host": "localhost"}} converts to a [server] header followed by host = "localhost".
Common mistakes and edge cases
- An array of objects becomes an array of tables.
{"servers": [{"host": "a.example.com"}]}converts to[[servers]]followed byhost = "a.example.com", one[[servers]]block per object, and the same text converts back to the original JSON. - Going TOML to JSON, a malformed line (missing
=, or a value that isn't quoted, a number,true/false, or a bracketed array) shows an explicit "Invalid TOML" error that names the line, rather than silently skipping it or turning it into a wrong value. - TOML comments (
#) are stripped during TOML to JSON conversion and have no equivalent when converting JSON to TOML, since JSON has no comment syntax to carry one over from.