Convert JSON to YAML
Indent, flow level,
quote style — yours.
Free JSON to YAML converter. Control indentation, flow level and quote style. Powered by js-yaml — the same parser used by ESLint, Webpack and Prettier. Runs entirely in your browser.
Three steps — paste your JSON and get clean YAML in seconds.
Paste a JSON object or array, or upload a .json file. The converter validates the JSON before converting — any syntax errors are reported with their position so you can fix them before converting.
Set indentation (2 or 4 spaces), flow level (how deep before switching to inline syntax), quote style for string values, and whether to sort keys alphabetically — useful for config files that need deterministic ordering.
Click Convert and copy the YAML to clipboard or download a .yaml file. The output is valid YAML 1.2 compatible with kubectl, Docker Compose, GitHub Actions, Ansible, Helm and any standard YAML parser.
Why configuration files prefer YAML over JSON.
JSON was designed as a data interchange format — compact, strict and universally parseable. YAML was designed as a human-friendly configuration language. The key advantages of YAML for config files are: no curly braces or brackets to balance, support for comments (with #), and cleaner multiline strings.
This is why the entire cloud-native ecosystem uses YAML: Kubernetes manifests, Docker Compose files, GitHub Actions workflows, Ansible playbooks and Helm charts are all YAML. If you have JSON configuration that needs to become part of any of these systems, converting to YAML is the first step.
The flow level setting is particularly useful when converting JSON to YAML for config files. A flow level of -1 (fully expanded) produces the most readable output — each key on its own line. A flow level of 2 or 3 keeps simple nested objects inline (like {port: 8080, protocol: TCP}) while still expanding the outer structure — a common pattern in Kubernetes port definitions.
Common workflows where YAML output is required.
kubectl and Helm both require YAML manifests. If you have JSON configs from a tool or API response that need to become Kubernetes resources, converting to YAML is the first step before adding comments and anchors.
GitHub Actions workflows are YAML files. Converting a JSON structure of steps, jobs or environment variables to YAML gives you a starting point for a workflow file that you can then edit and extend with GitHub Actions syntax.
Applications that accept YAML config (ESLint, Prettier, Jest, Babel, many others) are easier to configure in YAML than JSON. Converting your JSON config to YAML produces a cleaner file where you can add comments and use YAML anchors to avoid repetition.
YAML is significantly more readable than JSON in documentation, README files and Slack messages. Converting a JSON API response or config snippet to YAML before pasting it into a Confluence page or PR description makes it much easier for colleagues to read.
What each setting controls in the YAML output.
| Option | Values | What it does |
|---|---|---|
| Indentation | 2 spaces · 4 spaces | 2 spaces is the standard for Kubernetes, Docker Compose, GitHub Actions and most YAML consumers. 4 spaces is preferred by some teams for deeper nesting readability — both are valid YAML. |
| Flow level | Block · Flow 3 · Flow 2 · Flow 1 | Controls at which nesting depth the output switches from block (indented) to flow (inline) style. Block keeps everything expanded — most readable. Flow from depth 3 keeps the outer two levels expanded and renders deeper objects inline — a common pattern for Kubernetes port and resource definitions. |
| Quote style | None · Single · Double | None uses bare unquoted strings wherever safe — the most compact and natural YAML. Single or Double quotes every string value — useful when strings contain special characters or when the downstream parser requires quoted strings. |
| Key order | Original · Alphabetical | Original preserves the key order from the JSON input. Alphabetical sorts all keys at every nesting level — useful for config files where deterministic ordering makes diffs cleaner in version control. |
Other free converters you might need next.
JSON converted in
your browser. No upload.
JSONshift uses js-yaml — the most widely deployed JavaScript YAML library, used by ESLint, Webpack, Prettier and over 150 million npm downloads per week — to generate YAML entirely in your browser. Your JSON is never transmitted to any server.
The output is valid YAML 1.2 — compatible with kubectl, Docker Compose, GitHub Actions, Ansible, Helm, PyYAML, gopkg.in/yaml.v3 and every other major YAML parser. No proprietary extensions, no custom syntax.
