IT Market
Tools/Code/Documents/JSON to YAML Converter Online — Free
JSON → YAML

Конвертируйте JSON в YAML формат

Tool guide

JSON to YAML Converter Online — Free

Docker Compose, Kubernetes manifests, GitHub Actions workflows and Ansible playbooks all expect YAML, but the data usually arrives as JSON — from an API, a settings export, a server response. Paste the object or array into the JSON Input box, press Convert, and the same structure comes back as indented YAML with no braces and no quoted keys. js-yaml does the work inside the tab, so an internal config is safe to paste. See also: convert a YAML config back to JSON, find the missing comma in the source JSON, the same object written as XML.

How to use it

  1. Paste an object or array into the JSON Input box; keys need double quotes and there must be no trailing commas.
  2. Press Convert and the indented result appears in the YAML Output box below.
  3. Check the nested parts: objects become indented blocks, arrays become dash-prefixed lines.
  4. Use Copy YAML to move the text into your editor, or Download YAML to save a .yaml file.
  5. If nothing happens, the source JSON is invalid — the parser stops at the first bad character.

FAQ

What indentation does the output use?

Two spaces per level, the js-yaml default and the usual style for docker-compose.yml and Kubernetes manifests. Tabs are never emitted because the YAML spec forbids them for indentation. If your repo uses four spaces, reindent in your editor — the width is not configurable here.

Is key order preserved?

Yes, keys come out in the order they appear in the source. The one exception is purely numeric keys such as "1" and "2": the JavaScript engine hoists those to the front of the object, so they will lead in the YAML too. Prefix them with a letter if order matters.

How is non-Latin text handled?

Cyrillic, Greek and CJK values pass through as UTF-8 rather than \u escapes. A value only gets quoted when it starts with a special character, contains a colon followed by a space, or would otherwise read as a number or as yes/no. Save the resulting file as UTF-8 to keep it intact.

How large a document can I paste?

There is no fixed cap; the limit is the tab's memory. A few megabytes convert almost instantly, but tens of megabytes will freeze the tab during parsing, especially on a phone. For dumps that big, reach for yq or a small script locally.

Convert does nothing — what is wrong?

Almost always the input: single quotes instead of double, a trailing comma, a // comment, or a fragment truncated during copy. JSON allows none of those. Run the text through a JSON validator, fix the first error it reports, and paste again.

Can I go back from YAML to JSON?

Yes, there is a separate YAML to JSON page built on the same library. A round trip is a decent sanity check: if the JSON you get back matches what you started with, nothing was lost on the way into YAML.

Examples

Service settings from an API into docker-compose
Before: {"image": "nginx:1.25", "ports": ["80:80"], "environment": {"TZ": "UTC"}}
After: image: nginx:1.25 ports: - '80:80' environment: TZ: UTC
Array of objects for a workflow step
Before: [{"name": "build", "run": "npm ci"}, {"name": "test", "run": "npm test"}]
After: - name: build run: npm ci - name: test run: npm test