Skip to main content
SiteIndex
EntwicklungSofort einsatzbereit

YAML in JSON umwandeln

Wandle YAML mit Validierung und sofortiger Ausgabe für Konfigurationsdateien und API-Abläufe in JSON um.

Anleitung

Interaktiver Arbeitsbereich

Kein Konto erforderlich
YAML-zu-JSON-Konverter

YAML 1.2 mappings and sequences, including nested lists and multiline strings. Comments are omitted from JSON. Duplicate or non-string keys, custom tags, cycles, and values JSON cannot represent produce errors instead of silent data loss. Multi-document files (separated by ---, such as Kubernetes manifests) convert to a JSON array of documents.

You can also drag and drop a .yaml or .yml file onto the input. Conversion runs as you type.

How values are typed (YAML 1.2 core schema)

This converter follows the YAML 1.2 core schema, so words that YAML 1.1 tools turn into booleans stay strings here — the classic “Norway problem”: country: NO converts to {"country": "NO"}, and yes, on and off also stay strings. Hex (0x1A) and octal (0o17) integers do become numbers. Anchors and aliases are expanded into plain values, comments are dropped, and an integer beyond JavaScript's safe range must be quoted in the YAML so it is preserved as text instead of losing precision.

Python (PyYAML)
import json, yaml

data = yaml.safe_load(open('config.yaml'))
print(json.dumps(data, indent=2))
JavaScript (js-yaml)
import { load } from 'js-yaml';

const data = load(yamlText);
console.log(JSON.stringify(data, null, 2));
Command line (yq)
yq -o=json '.' config.yaml
Was ist YAML-zu-JSON-Konverter?

Wandle YAML mit Validierung und sofortiger Ausgabe für Konfigurationsdateien und API-Abläufe in JSON um.

So funktioniert es

Wandle YAML mit Validierung und sofortiger Ausgabe für Konfigurationsdateien und API-Abläufe in JSON um.

Typische Anwendungen

Wandle YAML mit Validierung und sofortiger Ausgabe für Konfigurationsdateien und API-Abläufe in JSON um.

Einschränkungen

Die Ergebnisse können von Browser, Netzwerk, Eingaben und externen Diensten abhängen. Dieses Tool dient der Information und ersetzt keine fachkundige Diagnose oder Beratung.

Häufige Fragen
Was ist YAML-zu-JSON-Konverter?
Wandle YAML mit Validierung und sofortiger Ausgabe für Konfigurationsdateien und API-Abläufe in JSON um.

Ähnliche Tools