Converters
YAML ↔ JSON Converter
Convert YAML configuration to JSON or serialize JSON as YAML. Check type changes, comment loss, parser errors, and examples in both directions.
About this tool
When to use it
Convert YAML configuration to JSON or serialize JSON as YAML. Check type changes, comment loss, parser errors, and examples in both directions.
How to use it
Choose YAML to JSON when an API expects a JSON body but your configuration is written in YAML. Choose JSON to YAML for a configuration file that benefits from readable lists and indentation. Select the direction before pasting: switching direction replaces the input with a matching example and clears the output. Convert, inspect types, then copy, share, or download the result.
Guide updated . Examples checked against this implementation.
Worked examples
YAML to JSON: named settings
Input
name: demo
enabled: trueExpected output
{
"name": "demo",
"enabled": true
}The boolean stays a boolean. Quote a YAML value when it must remain text rather than a parsed number or boolean.
JSON to YAML: a region list
Input
{"retries":3,"regions":["in","eu"]}Expected output
retries: 3
regions:
- in
- eu
The array becomes a block list. The serializer chooses indentation and quoting, and ends the YAML document with a newline.
Errors and unsupported input
items: [Close the sequence bracket or rewrite the values as an indented list. Check the parser location, then retry.
value: .infJSON cannot represent infinity or NaN. Use a quoted string or an agreed finite value; conversion rejects these numbers instead of changing them to null.
Continue this workflow
- YAML ↔ TOML Converter: Convert a YAML mapping into TOML when your target application uses tables.
- JSON Diff: Compare converted JSON against a known configuration to inspect type and value changes.
Format references
Questions
Frequently asked questions
Will YAML comments appear in JSON?
No. Comments are not part of the converted values. Keep the original YAML when its explanations need to survive.
Does switching direction reuse the previous output?
No. It loads a matching example. Copy your result before switching, then paste it into the new input if you want to check a round trip.