JSON zu YAML
Übersetze JSON-Strukturen in sauberes YAML für Konfigurationsdateien.
Läuft in deinem Browser; deine Daten verlassen dein Gerät nieKostenlos, ohne Anmeldung
YAML output
The converted YAML will appear here.
So funktioniert es
The input is first parsed as JSON with precise error reporting. The resulting value is then serialized as YAML using a standards-compliant serializer (the yaml package, the same parser used by major tooling): nested objects become indented mappings, arrays become dash-prefixed lists, and strings are quoted only when necessary.
Funktionen
- Lossless conversion of all JSON data types
- 2 or 4 space indentation
- JSON errors reported with line and column
- No line wrapping, for predictable, diff-friendly output
- 100% client-side: nothing leaves your browser
So wird es verwendet
- Paste JSON, or upload a .json file.
- Choose 2 or 4 space indentation.
- Press Convert to YAML, then copy the result or download it as a .yaml file.
Beispiel
JSON:
{"name": "deployment", "replicas": 4, "labels": {"env": "production"}}
YAML:
name: deployment
replicas: 4
labels:
env: productionHäufig gestellte Fragen
- Does the conversion preserve the exact data?
- For JSON data (objects, arrays, strings, numbers, booleans and null) the conversion is lossless: the YAML output parses back to exactly the same structure. Note that YAML integers and floats may be normalized (for example 1.0 stays 1.0, but exotic number spellings like 1e3 are normalized), which is a property of the YAML number formats, not a bug.
- How are long strings handled?
- Line wrapping is disabled, so strings are emitted on a single line and quoted only when the YAML syntax requires it (for example strings that look like numbers or contain special characters). This keeps the output predictable and diff-friendly.
- Why convert JSON to YAML?
- YAML is the format of choice for Kubernetes manifests, CI pipelines (GitHub Actions, GitLab CI), Docker Compose files and many config tools. Hand-editing JSON is painful (no comments, braces everywhere), so converting a JSON payload to YAML makes it easier to read, comment and maintain.
- Can I choose the indentation?
- Yes: 2 or 4 spaces. Two spaces is the common convention for Kubernetes and most tooling; four is there if your project style requires it. YAML forbids tabs for indentation, so spaces are always used.
- What happens if my JSON is invalid?
- You get a clear error message with the line and column where the JSON parser failed, the same friendly diagnostics as the JSON Validator tool. Nothing is converted until the input parses.
- Is my data sent to a server?
- No. Conversion happens entirely in your browser with JavaScript. Nothing you type or paste is transmitted anywhere, and you can verify this in your browser's network inspector.