JSON ↔ YAML Converter
Convert configuration examples and structured data between JSON and YAML 1.2. Objects, arrays, strings, booleans, null and safely represented numbers are supported. This is not a comment-preserving YAML editor: unsupported structures and numbers produce errors instead of silently changing their meaning.
Key features
- Convert JSON to YAML or YAML to JSON
- Choose 2- or 4-space indentation for nested objects and arrays
- Reject duplicate keys, multiple documents, aliases and non-string keys
- Detect unsafe integers, decimal rounding and numeric underflow
How to use
- Choose a conversion direction and indentation width.
- Enter one JSON value or one YAML 1.2 document. Try the example to see the supported format.
- Run the conversion and inspect the result or error. Quote large identifiers as strings.
- Copy the result and separately validate any application-specific configuration rules.
Use cases
- Include API response examples in YAML documentation
- Review JSON configuration as YAML
- Check that identifier strings and boolean values keep their intended types
Frequently asked questions
Can I convert several YAML documents at once?
No. A stream containing multiple documents separated by --- produces an error. The tool will not convert only the first document and silently discard the rest.
Are comments, anchors and aliases preserved?
Comments, original quote styles, spacing and anchor names are not retained. Aliases that reference other values are rejected rather than expanded. YAML 1.1 merge-key behavior is not supported.
Why are some numbers rejected?
Numbers outside JavaScript’s safe integer range, or decimal values that change when parsed and printed, are rejected. Infinity, NaN and negative zero are also unsupported. Quote precise identifiers or decimal amounts when they must be treated as strings.
How are yes, dates and numeric keys handled?
Under YAML 1.2 Core rules, yes and ordinary date notation are strings. Mapping keys interpreted as numbers or booleans are rejected; quote them to make string keys. Custom tags are not supported.
Does JSON accept comments or duplicate keys?
No. JSON syntax validation excludes comments and trailing commas, and duplicate keys are rejected to avoid keeping only the last value. Scalar, array and object root values are supported.
What are the limits and validation scope?
Input is limited to 100,000 UTF-16 code units, 10,000 nodes and 100 nesting levels. This converts data formats; it does not validate Kubernetes or other application-specific schemas.
Privacy
Input and results are processed in browser memory; this tool does not upload or store them. Reloading clears them. Site-wide advertising and analytics may operate separately, but tool usage events do not contain your input or output.
Comments & questions