Convert YAML configuration into strict JSON data
YAML to JSON converts mappings, sequences, and supported YAML 1.2 scalar values into strict JSON. It helps move configuration examples into systems that accept only JSON.
When should you use it?
- Convert a YAML settings example to JSON.
- Inspect YAML data with the JSON viewer.
- Share a configuration value with a JSON-only API.
Example: YAML mapping becomes an object
The mapping becomes a JSON object and the YAML boolean becomes a JSON boolean.
name: Alex
active: true{"name":"Alex","active":true}Check which YAML values JSON can represent
JSON supports objects with string keys, arrays, strings, finite numbers, booleans, and null. YAML can express more, including complex mapping keys and cyclic aliases. Those structures cannot be transferred directly to JSON, so unsupported values fail instead of being silently rewritten. Comments and presentation choices also disappear because JSON has no equivalent for them.
Review numeric values after conversion
This direction uses JavaScript number semantics for decimal values. Precision-sensitive identifiers are safer as quoted strings in the YAML source. After conversion, inspect the fields that look numeric and test the result with the receiving schema. If the YAML configuration uses format-specific tags or behavior, consult the configuration system before assuming that converting its data produces an equivalent configuration file.
Make configuration data strict JSON.
Parse YAML into mappings, sequences, and scalar values, then export valid JSON with clear errors for unsupported values.
Paste YAML
Load local UTF-8 text. No referenced URLs are fetched.
Check the mapping
Duplicate keys, complex keys, and unrepresentable values are reported.
Export JSON
Copy or download the resulting document.
How do I convert a YAML configuration to strict JSON?
Paste a YAML 1.2 document and convert its mappings and sequences to JSON objects and arrays. Use quoted YAML strings when a value must remain text, then review the JSON types before handing the output to an API.
YAML mapping with a quoted identifier
yamlname: Alex
active: true
account: "00123"The JSON result keeps account as "00123" and active as true. Complex mapping keys and cyclic aliases cannot be represented as ordinary JSON.
Will every YAML document convert cleanly?
No. YAML supports values JSON cannot express, including non-string mapping keys and cyclic aliases. The tool reports those cases rather than silently changing the shape.
What should you check before using the result?
JSON cannot express cycles or non-finite numbers. Decimal parsing follows JavaScript number semantics, so check precision-sensitive values and implicit YAML types.
YAML can express more than JSON
JSON object names must be strings, and JSON cannot represent cycles or non-finite numbers. These cases produce an error rather than a guessed conversion.
Numeric values
Integer values are read as BigInt to avoid rounding during conversion. Decimal YAML values are converted to JSON numbers; check precision-sensitive data before using the output.
Technical reference: YAML 1.2.2 specification