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

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

Tool guide

YAML to JSON Converter Online — Free

The other direction: the config is written with indentation, but you need an object — for an API call, for a fixture, for code that only speaks JSON. Paste the manifest, playbook or settings file into the YAML Input box (its placeholder shows name: John / age: 30) and press Convert. There is a second benefit: if the YAML is malformed you get no object at all, which is the fastest way to catch a broken indent. Everything runs in the browser. See also: turn JSON settings into a YAML config, format the resulting JSON and spot errors, export a list from the config to CSV.

How to use it

  1. Copy the whole .yml or .yaml file and paste it into the YAML Input box, indentation included.
  2. Strip any tab characters out of the paste — YAML accepts spaces only, and a tab is the usual culprit.
  3. Press Convert; the JSON Output box shows a pretty-printed object rather than one long line.
  4. An empty output means the document did not parse: check the alignment of nested keys and the space after each colon.
  5. Take the result with Copy JSON, or save it to disk with Download JSON.

FAQ

Why did yes and on become true?

That is YAML itself: unquoted yes, no, on, off, true and false are booleans. If you actually want the string "yes" — a country code, a survey answer — quote it in the source: field: "yes". It then arrives in JSON as a string.

Are anchors and aliases supported?

Yes. js-yaml resolves anchors during parsing, so the JSON carries the expanded value and the alias disappears — JSON has no way to express one. Block scalars written with | or > become plain strings with \n line breaks, and merge keys behave the same way.

Can I paste a multi-document file with --- separators?

Only a single document is parsed. A --- separator makes the parser stop, because JSON has no concept of a document stream. Split the file and run each section on its own, which is the usual approach with multi-part Kubernetes manifests.

The output is empty — how do I find the bad line?

Three causes cover most cases: a tab character instead of spaces, a missing space after a colon, and a nested key that drifted out of alignment. Paste the document in growing chunks; the section where the output disappears holds the error.

How are unquoted dates converted?

A bare 2026-09-06 parses into a Date and serialises to an ISO string with a time part and a trailing Z. Quote the value in the YAML if you need the literal text to survive unchanged.

What happens to my comments?

Lines starting with # are dropped, because JSON has nowhere to keep them. Worth remembering when you convert a config for migration: the notes explaining each setting have to be preserved separately.

Examples

Kubernetes manifest fragment for an API call
Before: apiVersion: v1 kind: Service metadata: name: web labels: tier: front
After: { "apiVersion": "v1", "kind": "Service", "metadata": { "name": "web", "labels": { "tier": "front" } } }
Env list turned into a test fixture
Before: env: - DEBUG - TZ retries: 3 enabled: yes
After: { "env": ["DEBUG", "TZ"], "retries": 3, "enabled": true }