JSON to TOML Converter

Paste JSON and get valid TOML 1.1 as you type. Nested objects become tables, lists of objects become arrays of tables, and anything TOML cannot hold is flagged. It runs in your browser, so nothing is uploaded.

Round-trip
Valid JSONSample converted. Review the warning below.
17 → 18 lines

Converts as you type. Ctrl/⌘+Enter converts now,Ctrl/⌘+Shift+C copies the TOML.

  • Private by designRuns in this tab. No upload, no server code.
  • TOML 1.1 outputTables and arrays of tables, in the right order.
  • Exact numbersBig IDs keep every digit; 30.0 stays a float.
  • Nothing lost silentlyEvery null and wrapped value is listed.

Example: a deploy config in JSON and TOML

netlify.json
{
  "build": {
    "command": "npm run build",
    "publish": "dist"
  },
  "redirects": [
    {
      "from": "/blog/*",
      "to": "/news/:splat",
      "status": 301
    },
    {
      "from": "/old-pricing",
      "to": "/pricing",
      "status": 302,
      "force": true
    }
  ]
}
netlify.toml
[build]
command = "npm run build"
publish = "dist"

[[redirects]]
from = "/blog/*"
to = "/news/:splat"
status = 301

[[redirects]]
from = "/old-pricing"
to = "/pricing"
status = 302
force = true
The build object becomes a [build] table, and each object in theredirects list becomes its own [[redirects]] block, the layout anetlify.toml file uses.

How JSON data types map to TOML

JSON and TOML share most value types, so most of a JSON file carries over unchanged. The differences are in structure and in one missing type: TOML has no null.

Each JSON type and the TOML type the converter writes.
JSONTOMLWritten as
object (top level)root tablekey = value
nested objecttable[server.http]
array of objectsarray of tables[[products]]
array of valuesarrayports = [ 80, 443 ]
stringbasic stringname = "app"
whole numberinteger (64-bit kept)id = 9007199254740993
number with a decimal pointfloattimeout = 30.0
true / falsebooleandebug = false
nullno TOML typeremoved, or "", with a warning

What happens to null values when converting JSON to TOML?

TOML has no null, so a key set to null cannot be written as it is. The converter removes the key and lists it under the output with its full path, such as project.license. If your program expects the key to exist, switch the null values option to write an empty string instead.

How are nested JSON objects written in TOML?

Each nested object becomes a table header with a dotted path, such as [tool.ruff]. Plain keys are written before any table, because in TOML every key after a header belongs to that header.

Does the converter keep integers and floats apart?

Yes. 30 stays an integer and 30.0 stays a float. Most converters turn both into30. Large IDs above 253 also keep every digit instead of being rounded.

What the converter changes in your output

  • Top-level arrays and values are placed under a root key, because a TOML document must start as a table.
  • Key order follows the TOML rule: plain keys first, then [tables], then [[arrays of tables]].
  • Keys with spaces, dots or non-ASCII letters are quoted, for example "my key" = 1.
  • Comments cannot come across, because strict JSON has none.

Why does a top-level JSON array need a key in TOML?

A TOML file is always a table of key and value pairs. A JSON file that starts with [ has no key to hang the list on, so the converter names it root and tells you it did.

Can I convert JSON with comments or trailing commas?

Not yet. The converter reads strict JSON, so a tsconfig.json with comments shows an error at the first comment. Remove comments and trailing commas first.

Where TOML configuration files are used

Converting JSON to TOML usually means moving settings into one of these files:

  • Cargo.tomlRust package manifest
  • pyproject.tomlPython packaging and tool settings
  • hugo.tomlHugo site configuration
  • wrangler.tomlCloudflare Workers configuration
  • netlify.tomlNetlify build and redirect rules

JSON vs TOML for configuration files

JSON and TOML compared on the features that matter for config files.
FeatureJSONTOML
CommentsNoYes, with #
NullYesNo
Date and time typeNo, strings onlyYes, four types
Trailing commasNoIn arrays; in inline tables from TOML 1.1
Deep nestingBraces at every levelDotted table headers
Typical useAPIs and data exchangeHand-edited config files

Is TOML better than JSON for config files?

For files people edit by hand, usually yes: TOML allows comments, has real dates, and reads well without braces. JSON stays the better choice for data that programs send to each other.

How do I convert TOML back to JSON?

Use the TOML to JSON converter. It works the same way, in the other direction.

Is your JSON private?

Yes. The conversion runs as JavaScript in your browser tab. The site has no server code, and its security policy blocks the page from sending data anywhere. Your last input is kept only in this browser so it is still there when you come back; Clear removes it.

Is my JSON uploaded to a server?

No. Opening a file reads it on your device. You can check this in your browser's network panel: converting makes no requests.