Reading a Cargo.toml or pyproject.toml programmatically
Converting to JSON lets you query the manifest with jq or any JSON library in a CI script, without adding a TOML parser dependency.
Converts between TOML and JSON — TOML is common in modern config files (Cargo, pyproject, Go).
Converts between TOML and JSON — TOML is common in modern config files (Cargo, pyproject, Go).
[server] host = "127.0.0.1" port = 8080
{"server":{"host":"127.0.0.1","port":8080}}TOML tables become nested JSON objects.
The output mirrors the TOML structure as JSON objects, arrays and scalars.
Your input is sent to YAS infrastructure because the tool requires server-side processing or public network queries. Input is not stored.
curl -X POST "https://yas.sh/api/v1/tools/toml-json" \
-H "Content-Type: application/json" \
-d '{"input":"name = \"Jane\"\nage = 30","mode":"to-json"}'const res = await fetch("https://yas.sh/api/v1/tools/toml-json", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"input": "name = \"Jane\"\nage = 30",
"mode": "to-json"
}),
});
const data = await res.json();import requests
r = requests.post("https://yas.sh/api/v1/tools/toml-json", json={"input":"name = \"Jane\"\nage = 30","mode":"to-json"})
data = r.json()| Field | Type | Required | Description |
|---|---|---|---|
| input | string | Yes | TOML or JSON text |
| mode | string | No (default to-json) | to-json | to-toml |
{ "result": { "name": "Jane", "age": 30 }, "mode": "to-json" }Convert between TOML and JSON (mode: to-json | to-toml).
400 VALIDATION_ERROR — invalid input or unsupported option.413 PAYLOAD_TOO_LARGE — input exceeds the 64 KB limit.429 RATE_LIMIT_EXCEEDED — rate limit exceeded (60 req/min).TOML is parsed according to the v1.0.0 specification into the same kind of tree JSON produces — tables become objects, arrays become arrays, and scalars become strings, integers, floats, booleans or dates. Converting to JSON is then a direct serialization of that tree. The reverse direction walks a JSON value and emits TOML tables, promoting nested objects to [table] or [[array.of.tables]] headers where that produces more readable output.
The formats are not isomorphic, and the gaps matter. TOML has first-class date-times (offset, local, date-only and time-only) that JSON can only represent as strings; TOML distinguishes integers from floats while JSON has a single number type; and TOML forbids null entirely, so a JSON null has no landing place and is dropped or must be represented by omitting the key.
Converting to JSON lets you query the manifest with jq or any JSON library in a CI script, without adding a TOML parser dependency.
Projects moving from JSON config to TOML for comments and readability can convert the existing file rather than retyping it and introducing typos.
Dotted keys and [[array of tables]] syntax are the two things people get wrong. Seeing the JSON equivalent removes the ambiguity instantly.
Emitting JSON from code and converting is often simpler than templating TOML by hand, especially for arrays of tables.
What this tool deliberately does not do, and where it will disagree with other implementations.