YAML zu JSON Konverter

Benötigst du die umgekehrte Konvertierung?
JSON to YAML Converter

YAML Eingabe

1

JSON Ausgabe

Geben Sie YAML-Daten ein, um sie in JSON umzuwandeln

Ihre konvertierten Daten erscheinen hier

YAML online in JSON konvertieren – Schritt-für-Schritt-Anleitung

Nutzen Sie diesen YAML-zu-JSON-Konverter, um Konfigurationsdateien, Kubernetes-Manifeste oder CI/CD-Konfigurationen in JSON für APIs und Tools umzuwandeln.

  1. Schritt 1 – YAML einfügen oder hochladen

    • Fügen Sie YAML in den linken Editor ein oder laden Sie eine .yaml- oder .yml-Datei hoch.
    • Funktioniert mit Kubernetes-Konfigs, Docker-Compose-Dateien, GitHub-Actions-Workflows und allgemeinem YAML.
    • Multi-Dokument-YAML (getrennt durch ---) wird in ein JSON-Array konvertiert.
  2. Schritt 2 – Konvertierung prüfen

    • Die JSON-Ausgabe erscheint rechts und bewahrt verschachtelte Strukturen und Datentypen.
    • YAML-Kommentare werden entfernt (JSON unterstützt keine Kommentare).
    • Prüfen Sie, ob Arrays, Objekte und Skalare korrekt konvertiert wurden.
  3. Schritt 3 – Sonderfälle behandeln

    • YAML-Anker und Aliase müssen in komplexen Dateien ggf. manuell angepasst werden.
    • Boolesche Werte (true/false, yes/no) werden zu JSON-Booleans normalisiert.
    • Zahlen und Strings bleiben mit korrekter JSON-Formatierung erhalten.
  4. Schritt 4 – JSON kopieren oder herunterladen

    • Nutzen Sie „Kopieren“, um JSON sofort in die Zwischenablage zu übernehmen.
    • Oder „Download“, um als .json-Datei zu speichern.
    • Verwenden Sie das JSON in REST-APIs, Frontend-Apps oder Tools, die JSON-Eingaben erwarten.

Quick tips for YAML to JSON

  • Ensure indentation is consistent in your YAML; most conversion errors come from bad indent levels.
  • Multi-document YAML will be converted to a JSON array, which is ideal for lists of configs or resources.
  • After converting, run the JSON through the validator or formatter to catch any remaining structural issues.
Example: YAML to JSON
# YAML input
apiVersion: v1
kind: ConfigMap
metadata:
  name: app-config
data:
  database_url: postgres://localhost/db
  debug: true
  ports:
    - 8080
    - 8081

// JSON output
{
  "apiVersion": "v1",
  "kind": "ConfigMap",
  "metadata": {
    "name": "app-config"
  },
  "data": {
    "database_url": "postgres://localhost/db",
    "debug": true,
    "ports": [8080, 8081]
  }
}

Related YAML & JSON tools

Convert between formats and work with configuration files using these complementary tools.

Häufig gestellte Fragen

What YAML features are supported in the conversion?

The converter supports standard YAML features including scalars, sequences (arrays), mappings (objects), multi-line strings, and basic YAML syntax. Complex YAML features like anchors and references may have limited support.

How are YAML comments handled during conversion?

YAML comments are typically stripped during conversion to JSON since JSON doesn't support comments. The conversion focuses on the data structure rather than preserving comments.

Can I convert complex nested YAML structures?

Yes, the converter can handle deeply nested YAML structures with multiple levels of objects and arrays. The resulting JSON will maintain the same hierarchical structure.

What happens to YAML data types during conversion?

YAML data types are converted to their JSON equivalents: strings remain strings, numbers become JSON numbers, booleans stay as booleans, and null values are preserved. YAML's additional data types are converted to their closest JSON representation.

YAML zu JSON Konverter | JSONSwiss