Diese Seite ist noch nicht auf Deutsch verfügbar, daher zeigen wir die englische Version.

JSON to YAML Converter

Paste JSON and get clean YAML for Kubernetes manifests, Docker Compose, GitHub Actions or any config file. Both sides stay editable and in sync.

Aktualisiert am
YAML indent
JSON indent
Open file

Both panes are editable — change either side and the other updates instantly.

Deine Daten verlassen nie deinen Computer. Die Verarbeitung erfolgt zu 100 % lokal im Browser.

So nutzt du: JSON to YAML

  1. Paste JSON into the JSON pane, open a .json file, or click Load sample.
  2. The YAML pane updates instantly. Pick a YAML indent of 2 or 4 spaces and optionally sort keys or quote every string.
  3. Edit the YAML directly if you like — the JSON side updates too.
  4. Click Copy or Download to save data.yaml.

What does a JSON to YAML converter do?

It parses a JSON document and re-serializes the same data as YAML. Because YAML 1.2 is a superset of JSON, every JSON value has an exact YAML equivalent: objects become mappings, arrays become sequences (- item), and strings, numbers, booleans and null stay the same type. The result is typically 20–40% shorter and far easier to read and edit by hand, which is why YAML is the standard for Kubernetes, Docker Compose, GitHub Actions, Ansible and OpenAPI specs.

Example

This JSON:

{
  "service": "api",
  "replicas": 3,
  "ports": [8080, 9090],
  "env": {"LOG_LEVEL": "info"}
}

becomes this YAML:

service: api
replicas: 3
ports:
  - 8080
  - 9090
env:
  LOG_LEVEL: info

How strings are quoted

The converter (powered by the widely used js-yaml library) only adds quotes where they are needed to keep the value a string. Values like "yes", "on", "123", "null" or "2024-01-01" are quoted because an unquoted yes would be read as a boolean by YAML 1.1 parsers (the famous “Norway problem”, where the country code NO turns into false). Strings containing : , # or leading spaces are also quoted. Multi-line strings are written as literal block scalars (|-) so line breaks stay readable. Enable Quote all strings if a downstream tool expects every string quoted.

JSON vs. YAML at a glance

JSONYAML
CommentsNot allowed# comment
StructureBraces and bracketsIndentation
QuotesRequired on keys and stringsUsually optional
Multi-line strings\n escapesBlock scalars | and >
ReuseNoneAnchors & and aliases *
Best forAPIs, data exchangeHuman-edited config

Tips for config files

Indentation in YAML must use spaces, never tabs. Two spaces is the convention for Kubernetes and most CI systems. After converting, you can add comments to explain settings — something JSON cannot hold. To go the other way, use the YAML to JSON converter; to tidy the JSON first, run it through the JSON Formatter.

Auch gesucht als: json to yml, convert json to yaml, json yaml converter, json2yaml, kubernetes yaml, yaml generator.

Passende Tools zu: JSON to YAML

  • JSON to CSV — Turn a JSON array into a spreadsheet-ready CSV.
  • JSON to TypeScript — Paste a JSON sample — an API response, a config — and get ready-to-use TypeScript interfaces with nested types, optional properties and union types.
  • JSON Schema Validator — Paste a schema and some JSON to see exactly which values break which rule — or generate a starting schema from example data.
  • JSONPath Tester — Type a JSONPath query and instantly see what it selects — with the exact path of each match.

Häufige Fragen

Is YAML a superset of JSON?
Yes, since YAML 1.2 (2009) any valid JSON document is also valid YAML. That is why the conversion is lossless: the data and types are identical, only the syntax changes.
Why are some of my strings quoted in the YAML output?
Strings such as "yes", "off", "0123" or "1.0" would be interpreted as booleans or numbers if left unquoted, so they are quoted to preserve them as strings.
Can I convert JSON to YAML for Kubernetes?
Yes. Paste the JSON output of kubectl get … -o json and you get YAML you can save as a manifest. Remove server-generated fields such as status, uid and resourceVersion before applying it again.
Is my data sent anywhere?
No. The conversion runs in your browser using the open-source js-yaml library; nothing is uploaded.
Kann ich JSON to YAML als Web-App installieren und offline nutzen?
Ja. JSON to YAML ist eine installierbare Web-App (PWA) – sie wird über Ihren Browser installiert und nicht aus einem App-Store heruntergeladen. Klicken Sie oben auf dieser Seite in Chrome oder Edge (Windows, macOS, Linux, ChromeOS) auf „App installieren“ oder verwenden Sie auf Android-Geräten „Teilen“ → „Zum Startbildschirm hinzufügen“ auf dem iPhone und iPad bzw. „Datei“ → „Zum Dock hinzufügen“ in Safari 17+ auf einem Mac. Die App öffnet sich dann in einem eigenen Fenster mit einem eigenen Symbol, und da sie vollständig in Ihrem Browser ausgeführt wird, funktioniert sie auch offline. Firefox auf dem Desktop kann keine Web-Apps installieren. So funktioniert die Installation.

Ähnliche Tools