YAML to JSON

Convert YAML into JSON. Dates become ISO strings; anchors and aliases are resolved.

Input

The YAML to convert.
Spaces per level. 0 gives one compact line.

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/yaml-to-json \
  -H 'Content-Type: application/json' \
  -d '{"input":{"text":"name: app\nports:\n  - 80\n  - 443","indent":0}}'
import json, urllib.request

body = {'input': {'text': 'name: app\nports:\n  - 80\n  - 443', 'indent': 0}}
request = urllib.request.Request("https://setget.net/v1/tools/yaml-to-json", 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/yaml-to-json", {
  method: "POST",
  headers: {"Content-Type": "application/json"},
  body: JSON.stringify({"input":{"text":"name: app\nports:\n  - 80\n  - 443","indent":0}}),
});
console.log((await response.json()).result);
Tool: run_tool
Arguments:
{
  "slug": "yaml-to-json",
  "input": {
    "text": "name: app\nports:\n  - 80\n  - 443",
    "indent": 0
  }
}
{
  "input": {
    "text": "name: app\nports:\n  - 80\n  - 443",
    "indent": 0
  }
}

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

Inputs

NameTypeRequiredWhat it does
text string yes The YAML to convert.
indent integer no Spaces per level. 0 gives one compact line. Default: 2. From 0 to 8.

Example

Input
{
  "text": "name: app\nports:\n  - 80\n  - 443",
  "indent": 0
}
Result
{
  "text": "{\"name\":\"app\",\"ports\":[80,443]}"
}