DevToolsmith

JSON to TOML Converter

Turn a JSON object into idiomatic TOML, with tables for nested objects and arrays of tables for lists of objects. Values TOML can't represent, like null, are flagged instead of silently producing a broken file.

Runs 100% in your browser — nothing is uploaded

JSON
Tip: drop a file here303 chars · 303 bytes · 15 lines
TOML
241 chars · 241 bytes · 17 lines

Example

JSON
{
  "title": "Edge proxy",
  "server": {
    "host": "0.0.0.0",
    "port": 8443,
    "tls": {
      "cert": "/etc/ssl/proxy.pem"
    }
  },
  "upstreams": [
    {
      "name": "api",
      "url": "http://10.0.0.5:3000",
      "weight": 3
    },
    {
      "name": "web",
      "url": "http://10.0.0.6:8080",
      "weight": 1
    }
  ]
}
TOML
title = "Edge proxy"

[server]
host = "0.0.0.0"
port = 8443

[server.tls]
cert = "/etc/ssl/proxy.pem"

[[upstreams]]
name = "api"
url = "http://10.0.0.5:3000"
weight = 3

[[upstreams]]
name = "web"
url = "http://10.0.0.6:8080"
weight = 1

The nested server.tls object becomes its own [server.tls] table. Each upstream becomes an [[upstreams]] entry, which is how TOML expresses a list of objects.

When to use TOML instead of JSON

TOML is designed for configuration that humans edit. It supports comments, has an unambiguous syntax (unlike YAML's indentation rules), and has first-class date and time types. That's why it's used by Cargo.toml (Rust), pyproject.toml (Python), Hugo, Netlify, Deno and many CLI tools.

FeatureJSONTOMLYAML
CommentsNoYesYes
NullYesNoYes
DatesNo (strings)YesPartial
Whitespace-sensitiveNoNoYes
Deep nestingEasyVerboseEasy

For deeply nested data, YAML is often more compact. Converting a TOML file back? Use TOML to JSON.

Frequently asked questions

How do I convert JSON to TOML?

Paste a JSON object into the tool above. Simple values become key = value pairs, nested objects become [table] sections, and arrays of objects become [[array of tables]]. Copy or download the result as a .toml file.

Why does my JSON fail to convert?

A TOML document is always a table, so the top-level JSON value must be an object, not an array or a single value. Wrap it, for example as {"items": [...]}.

What happens to null values?

TOML has no null. The converter removes null values and lists their paths under the output, so you can decide whether to delete the key, use an empty string, or use a sentinel value.

Is mixing types in an array allowed?

Yes, since TOML 1.0 arrays may contain mixed types, such as [1, "a"]. Arrays made only of objects are written as arrays of tables for readability.