Skip to content

TOML to JSON Converter

Convert TOML to JSON as you type, from Cargo.toml, pyproject.toml or any other config file.

Input · TOML
⇄
Output · JSON
Valid TOMLRuns in your browser

Load from a URL

Your browser fetches it directly, so the server must allow cross-origin requests (CORS).

How to convert TOML to JSON

  1. Paste TOML or open a .toml file.
  2. Choose the JSON Indent: 2 spaces, 4 spaces or tabs.
  3. Press ⇄ to send the JSON to JSON to TOML.

Example: netlify.toml

[build]
  command = "npm run build"
  publish = "dist"

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

[[redirects]]
  from = "/api/*"
  to = "/.netlify/functions/:splat"
  status = 200
  force = true
{
  "build": {
    "command": "npm run build",
    "publish": "dist"
  },
  "redirects": [
    {
      "from": "/old-blog/*",
      "to": "/blog/:splat",
      "status": 301
    },
    {
      "from": "/api/*",
      "to": "/.netlify/functions/:splat",
      "status": 200,
      "force": true
    }
  ]
}

[build] became an object and the two [[redirects]] blocks an array, in file order. Indentation inside tables means nothing in TOML.

Values with no JSON type

TOML JSON
published = 2026-11-05T09:30:00+01:00 "2026-11-05T09:30:00.000+01:00"
day = 2026-11-05 "2026-11-05"
mode = 0o755 493
mask = 0xFF 255
budget = 1_500_000 1500000
limit = inf null

Dates and times become strings that keep their offset, with milliseconds added. Hex, octal and binary integers become decimal, and inf and nan become null. Comments are dropped, since JSON has no comments.

Errors and large integers

Syntax errors stop the conversion with the line and column: an unquoted name = Jane reports invalid value, and a key set twice reports trying to redefine an already defined table or value. Integers outside ±9,007,199,254,740,991 stop with integer value cannot be represented losslessly instead of being rounded.

To pull settings out of a large file, query the JSON in the JSONPath tester. For YAML configs, use YAML to JSON.

Questions

What happens to dotted table names like [tool.ruff]?

They become nested objects: {"tool": {"ruff": {...}}}.

Why did 6.0 become 6?

JSON numbers do not record float or integer, so 6.0 prints as 6. The value is the same.

Is my config uploaded?

No. It is parsed in your browser, so tokens and database URLs stay on your machine.

Related tools

Esc