Convert JSON into readable YAML
JSON is common in API responses and application data. YAML is often chosen for files people edit by hand, such as service settings and deployment configuration. This converter takes valid JSON and writes the same parsed data as YAML, so you can reuse an existing object or array in a workflow that accepts YAML.
Paste JSON or open a local .json file, select Convert to YAML, then review the output before copying or downloading the .yaml file. The converter uses two-space indentation and shows the root data type and output size.
Example: JSON object and array in YAML
Here is a JSON document with an object, a Boolean, a number, and an array:
{
"service": {
"name": "catalog",
"enabled": true
},
"retries": 3,
"regions": ["us-east-1", "eu-west-1"],
"note": "deploy after review"
}
The YAML representation uses indentation for the nested object and hyphens for array items:
service:
name: catalog
enabled: true
retries: 3
regions:
- us-east-1
- eu-west-1
note: deploy after review
YAML indentation is part of the structure. Use spaces rather than tabs to indent YAML, and keep the output intact when pasting it into another file.
How to convert JSON to YAML
- Paste valid JSON into the input, or select Open JSON to choose a local file. The file picker accepts files up to 50 MiB.
- Select Convert to YAML. The converter parses the JSON and creates YAML output.
- Review the output and the status message. The tool parses the generated YAML and checks that it represents the same data as the parsed JSON.
- Select Copy or Download to use the result.
If you edit the input after converting, the old output is cleared. Convert again to create an updated YAML result. Large files may take longer to parse and can use substantial browser memory.
What the converter checks—and what it cannot check
The round-trip check confirms that the generated YAML parses back to the same structure using the converter's YAML library. It does not verify that a Kubernetes manifest, CI workflow, application config, or other target file meets that product's schema or version rules. Run the output through the target application's own validator before deploying or relying on it.
JSON must be valid before conversion. Standard JSON does not allow comments, single-quoted strings, unquoted keys, or trailing commas. If the input is rejected, use the JSON Validator to find syntax issues before trying again.
Data types and numeric precision
JSON objects become YAML mappings, arrays become sequences, and strings, numbers, Booleans, and null are serialized as YAML values. YAML parsers can differ in how they interpret plain scalars, so check important values in the system that will read the file—especially strings that resemble dates, numbers, or Boolean words.
The converter warns when it finds an integer outside JavaScript's safe range. Such values may already have lost precision when the browser parses the JSON. If a long number is an identifier rather than a quantity, represent it as a quoted string in the source. Check high-precision decimals as well.
Does converting JSON to YAML add comments?
No. JSON has no comment syntax, so a conversion cannot preserve comments that are not in the input or invent explanations for configuration values. Add comments to the YAML afterward if your team or target format needs them.
Where is my JSON processed?
The converter parses the input in your browser. It loads its YAML conversion library from jsDelivr, but the JSON document is not included in that library request. The page needs access to jsDelivr for the conversion library to load; see the privacy information for details.
JSON to YAML and related tools
Use YAML when the receiving tool expects it; keep JSON when an API or application requires JSON. If you need to change the source data first, use the JSON Editor. The JSON Formatter can make JSON easier to inspect, and JSON to CSV is useful when you need tabular data.
Frequently asked questions
Is JSON to YAML conversion lossless?
The converter checks that its generated YAML parses back to the same structure as the JSON value parsed in the browser. Very large integers can lose precision in JavaScript before conversion, and another YAML parser may interpret some plain values differently. Review important values in the target system.
Can I convert nested objects and arrays?
Yes. Nested objects are represented with indentation, and array values appear as YAML sequence items with hyphens.
Can I convert a JSON file?
Yes. Choose Open JSON and select a .json file up to 50 MiB. You can also paste JSON into the input area.
Why did conversion fail?
The input may not be valid JSON, or the YAML library may not have loaded. Check the JSON syntax and the status message, then try again when the conversion library is available.
Does the converter support YAML comments?
The output contains the data represented by the JSON. It does not add comments; add any needed comments to the YAML afterward.
Is the generated YAML ready for my configuration file?
It may be a starting point, but a successful conversion only checks the data round-trip. Validate it with the target application's schema, version, and rules before using it.