JSON to YAML Converter
Turn JSON into readable block-style YAML, with strings quoted only when necessary.
Processed locally in your browser/ Your data stays in your browser.
What is JSON to YAML Converter?
YAML is easier to read and edit by hand than JSON, which is why configuration for Kubernetes, Docker Compose, CI systems and OpenAPI is often written in YAML. Converting existing JSON is a common first step.
This converter validates your JSON with a strict parser, then builds a YAML 1.2 document. Strings that would otherwise be read as another type (true, 123, null, empty text, text containing ": ") are quoted automatically, multi-line strings become block scalars, and integers beyond JavaScript’s safe range are written digit for digit. You choose the indentation, the line width and whether keys are sorted alphabetically.
How does it work?
- Paste your JSON.
- Choose 2 or 4 spaces, the line width (0 for no wrapping) and whether to sort keys.
- Read the YAML output; invalid JSON is reported with its line and column.
- Copy or download the YAML, or Swap to convert it back to JSON.
Common use cases
- Converting a JSON API response or settings file into a YAML configuration.
- Turning an OpenAPI JSON document into YAML for editing.
- Producing readable Kubernetes or Compose snippets from generated JSON.
- Checking how a JSON structure looks in block style before committing it.
Examples
Try this input in the tool above:
{"name":"api","version":"1.4.2","ports":[80,443],"env":{"MODE":"prod","DEBUG":"false","RETRIES":3},"notes":"line one\nline two","owner":null,"big":12345678901234567890}name: api version: 1.4.2 ports: - 80 - 443 env: MODE: prod DEBUG: "false" RETRIES: 3 notes: |- line one line two owner: null big: 12345678901234567890
Privacy
JSON to YAML Converter runs entirely in your browser. The text or files you provide are processed on your device and are not uploaded, logged or stored on our servers.
Limitations
JSON has no comments or anchors, so none are created. Strings such as yes or no are written unquoted, which YAML 1.1 parsers may read as booleans; quote them manually if your target uses YAML 1.1.
Frequently asked questions
Are strings quoted correctly?
Yes. Values that could be misread as booleans, numbers or null, that are empty, or that contain special sequences are quoted, so converting back gives the same data.
What happens with very large integers?
They are parsed exactly and written digit for digit, so identifiers such as 12345678901234567890 are not rounded.
Can I get a compact YAML?
Set the line width to 0 to avoid folding long strings. Block style itself is always used; for flow style keep the JSON, which is valid YAML.
Related tools
YAML to JSON Converter
Turn YAML into strict JSON, resolving anchors, aliases and merge keys along the way.
JSON & Data
JSON Formatter & Beautifier
Turn a minified or messy JSON document into readable, consistently indented text, with a precise error message if the JSON is invalid.
JSON & Data
YAML Formatter & Beautifier
Re-indent and normalise a YAML file while keeping comments, anchors and multi-document structure.
JSON & Data
JSON Validator
Check whether a piece of text is valid JSON and locate the exact character where it goes wrong.
JSON & Data
JSON to XML Converter
Turn a JSON document into well-formed XML with control over the root element, attributes and formatting.
JSON & Data
XML to JSON Converter
Turn an XML document into JSON, keeping attributes, repeated elements and text content in a predictable structure.
JSON & Data
JSON Key Sorter
Reorder the keys of every JSON object alphabetically to get a stable, canonical document.
JSON & Data