Next-Gen App & Browser Testing Cloud
Trusted by 2 Mn+ QAs & Devs to accelerate their release cycles

Turn any JSON object into valid TOML v1.0.0, including nested tables and arrays of tables, without leaving your browser.
A JSON to TOML converter rewrites a JSON object as a TOML document, the configuration format defined by TOML v1.0.0. JSON nests everything in braces, while TOML uses named sections such as [database], so the same data becomes easier to read and comment in a config file.
All processing happens in your browser. Your JSON is never uploaded, which matters when a config file holds internal host names or credentials. For the reverse direction and related formats, TestMu AI also offers a TOML to YAML converter and a JSON to YAML converter.
The converter parses your text with RFC 8259 JSON rules, then walks the resulting tree and maps each shape onto its TOML equivalent.
Here is the sample configuration above, shown as JSON and as the TOML this tool produces.
{ "database": { "ports": [8001, 8002] },
"product": [ { "name": "hammer", "sku": 738594937 } ] }
[database]
ports = [8001, 8002]
[[product]]
name = "hammer"
sku = 738594937TOML v1.0.0 defines ten value types, and none of them is null. The format treats an absent setting as a key that is simply not written, so there is no way to store null inside an array either. JSON has no such restriction, which makes null the one shape that cannot cross over unchanged.
Rather than dropping nulls silently, this converter asks you to choose. Omit the key matches how TOML expresses an unset value and is the default.
Use an empty string keeps the key present when a downstream parser expects it. Report an error is useful in a review workflow, where a null means the source data needs fixing before the config ships.
Keep JSON where machines exchange data over an API, and use TOML where a person maintains the file. If you are generating those config files as part of an automated suite, the KaneAI test agent can author and maintain the tests that consume them. To inspect a payload before converting it, use the JSON parser or the JSON to XML converter.
Yes. The JSON to TOML converter from TestMu AI is completely free, with no sign up, no account, and no limit on how many documents you convert. It is part of the free developer toolkit maintained by TestMu AI.
No. The conversion runs in JavaScript on your own machine, so nothing is uploaded to a server and nothing is stored. That makes the tool safe for configuration files that contain internal host names, connection strings, or API keys.
The converter reports an error, because a TOML document must be a table at the top level. Wrap the array in an object first, for example turn [1, 2, 3] into { "items": [1, 2, 3] }, and the conversion will succeed.
The output targets TOML v1.0.0, released on 11 January 2021. That version defines the ten value types, dotted table headers, and the array of tables syntax that this converter emits for arrays of JSON objects.
This page converts in one direction, from JSON to TOML. To move TOML into another format you can use the TOML to YAML converter from TestMu AI, then convert the YAML result to JSON with the YAML to JSON tool.
Key order is preserved, with one adjustment required by the format. Plain values are written before any table header, because a key placed after a [section] header would be parsed as part of that section rather than the parent table.
Did you find this page helpful?
TestMu AI forEnterprise
Get access to solutions built on Enterprise
grade security, privacy, & compliance