YAML ↔ JSON Converter
Convert YAML to JSON and JSON to YAML as you type, with 2 or 4-space indentation, key sorting and line-numbered parse errors.
YAML ↔ JSON Converter
Supported YAML features
Strings (quoted and unquoted), numbers, booleans (true/false), null, and special floats. YAML 1.2 core reads yes/no as strings.
Nested objects via indentation, arrays with dash prefix, and mixed nesting at any depth.
Inline arrays [a, b, c] and inline objects {a: 1, b: 2} with proper nesting support.
Literal (|) and folded (>) multi-line strings with strip, clip, and keep chomp modes.
Related tools: YAML/JSON5 config validator • TOML editor
Updated . Provided as is. Check the output before you rely on it in production.
How to use YAML ↔ JSON Converter
- 1
Choose a direction
Pick YAML → JSON or JSON → YAML, then paste your input. Swap flips the direction and moves the output into the input.
- 2
Set output options
Choose the indent width and optionally sort keys alphabetically.
- 3
Check for errors
Invalid input reports the parse error, such as bad indentation or an unclosed bracket, so you can fix it before converting.
- 4
Copy the result
Copy or download the converted output for your config files, code or documentation.
Questions and answers
What is YAML to JSON Converter?
Does YAML to JSON Converter store or send my data?
Why would I convert between YAML and JSON?
Use it as an API
YAML ↔ JSON Converter is also callable as a free HTTP JSON API at
https://aidevhub.io/api/yaml-json/ — GET with query
parameters or POST with a JSON body, no authentication, CORS enabled, fair use
(abusive traffic is throttled at the edge; there is no per-request quota header). Responses return
{ ok, tool, result, meta }.
curl -s -X POST https://aidevhub.io/api/yaml-json/ \
-H "Content-Type: application/json" \
-d '{"input":"name: test\nreplicas: 2","direction":"yaml_to_json"}' Machine-readable contract: /api/tool/yaml-json.json All API endpoints: /agents/ LLM site index: /llms.txt
For AI agents: how to call this tool
Machine-readable contract, endpoints and examples. Humans can ignore this section.
Best Path For Builders
Dedicated API endpoint
Deterministic outputs, machine-safe contracts, and production-ready examples.
Dedicated API
https://aidevhub.io/api/yaml-json/ OpenAPI: https://aidevhub.io/api/openapi.yaml