JSON to YAML
Convert JSON to YAML, with safe quoting and nested structure.
This tool needs JavaScript enabled to run in your browser.
What this tool does
This tool converts JSON into YAML. Paste JSON, or import a .json file, and it writes the equivalent YAML with nested mappings and sequences laid out by indentation. The conversion runs in your browser.
How the conversion works
Objects become YAML mappings, arrays become sequences, and the nesting is shown with two-space indentation. Strings that would otherwise be read as something else, such as true, null or a number, are quoted so they stay strings. Values with a colon, a hash or other special characters are quoted too, so the YAML parses back to the same data.
Common use cases
- Turning a JSON config or payload into YAML for a tool that prefers it.
- Making a nested structure easier to read.
- Preparing fixtures or CI configuration from a JSON source.
Good to know
YAML has features JSON does not, such as anchors and multiple documents, which a conversion from JSON never needs. The output sticks to the plain, widely supported subset so it loads anywhere. Key order follows the JSON input.
Frequently asked questions
- Will the YAML parse back to the same data?
- Yes. Strings that look like numbers, booleans or null, and strings with special characters, are quoted so they stay strings.
- Which YAML features are used?
- The output uses the plain, widely supported subset: mappings, sequences and scalars. It avoids anchors and other features a JSON source never needs.
Learning resources
Testsmith also runs hands-on courses and a free practice app for the skills behind this tool.