🧩

TOML to JSON

Parse TOML into JSON.

POST 1 credit /v1/convert/toml-to-json
curl -X POST "https://convert.toolkitapi.io/v1/convert/toml-to-json" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"toml": "[server]\nhost = \"localhost\"\nport = 8080"}'
import httpx

resp = httpx.post(
    "https://convert.toolkitapi.io/v1/convert/toml-to-json",
    json={"toml": "[server]\nhost = \"localhost\"\nport = 8080"},
)
print(resp.json())
const resp = await fetch("https://convert.toolkitapi.io/v1/convert/toml-to-json", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"toml": "[server]\nhost = \"localhost\"\nport = 8080"}),
});
const data = await resp.json();
console.log(data);
# See curl example
Response 200 OK
{
  "json": {"server": {"host": "localhost", "port": 8080}}
}

Description

Parse TOML into JSON.

How to Use

1

1. POST a JSON body with `toml` (or `url`).

2

2. Read the parsed `json` from the response.

About This Tool

Parses TOML into JSON. TOML tables become nested JSON objects; array-of-tables become arrays of objects. Typed values (ints, floats, booleans, datetimes) are carried through.

Useful for reading `pyproject.toml`, `Cargo.toml`, or any TOML config inside a JSON-native pipeline.

Why Use This Tool

Frequently Asked Questions

Are datetimes preserved?
TOML datetimes are serialized as ISO-8601 strings (JSON has no native date type).
Are array-of-tables supported?
Yes — `[[foo]]` becomes a JSON array of objects.
What TOML version?
TOML 1.0 via the standard-library `tomllib`.

Start using TOML to JSON now

Get your free API key and make your first request in under a minute.