JSON to TOML

Convert a JSON object into TOML with tables and arrays of tables.

Input

A JSON object to convert.

Result

Fill in the input and press Run.

Your input is processed in memory and then discarded. It is not stored or logged. Even so, don't paste live passwords or keys into any online tool.

Use it from code or an agent

curl -s https://setget.net/v1/tools/json-to-toml \
  -H 'Content-Type: application/json' \
  -d '{"input":{"text":"{\"title\":\"x\",\"owner\":{\"name\":\"Sam\",\"admin\":true}}"}}'
import json, urllib.request

body = {'input': {'text': '{"title":"x","owner":{"name":"Sam","admin":true}}'}}
request = urllib.request.Request("https://setget.net/v1/tools/json-to-toml", json.dumps(body).encode(),
                                 {"Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(request))["result"])
const response = await fetch("https://setget.net/v1/tools/json-to-toml", {
  method: "POST",
  headers: {"Content-Type": "application/json"},
  body: JSON.stringify({"input":{"text":"{\"title\":\"x\",\"owner\":{\"name\":\"Sam\",\"admin\":true}}"}}),
});
console.log((await response.json()).result);
Tool: run_tool
Arguments:
{
  "slug": "json-to-toml",
  "input": {
    "text": "{\"title\":\"x\",\"owner\":{\"name\":\"Sam\",\"admin\":true}}"
  }
}
{
  "input": {
    "text": "{\"title\":\"x\",\"owner\":{\"name\":\"Sam\",\"admin\":true}}"
  }
}

Endpoint: POST /v1/tools/json-to-toml. Over MCP: run_tool with slug: "json-to-toml". Machine-readable: input schema, Markdown. Connect an agent.

Inputs

NameTypeRequiredWhat it does
text string yes A JSON object to convert.

Example

Input
{
  "text": "{\"title\":\"x\",\"owner\":{\"name\":\"Sam\",\"admin\":true}}"
}
Result
{
  "text": "title = \"x\"\n\n[owner]\nname = \"Sam\"\nadmin = true\n"
}

Questions

Why does a null value fail?
TOML has no null. Remove the key or give it a value before converting.