Конвертируйте JSON в YAML формат
Tool guide
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.
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.
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.
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.
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.
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.
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.
Before: {"image": "nginx:1.25", "ports": ["80:80"], "environment": {"TZ": "UTC"}} After: image: nginx:1.25 ports: - '80:80' environment: TZ: UTC
Before: [{"name": "build", "run": "npm ci"}, {"name": "test", "run": "npm test"}] After: - name: build run: npm ci - name: test run: npm test
Your rating and feedback help decide what to improve next.