Monu Tools

Μετατροπέας YAML σε JSON

Μετατρέψτε YAML σε JSON και JSON πίσω σε YAML, και προς τις δύο κατευθύνσεις. Επικυρώνει καθώς μετατρέπει και δείχνει σαφή σφάλματα. Όλα εκτελούνται στο πρόγραμμα περιήγησής σας.

Πώς να χρησιμοποιήσετε το YAML ⇄ JSON

  1. 01

    Επιλέξτε την κατεύθυνση: YAML σε JSON ή JSON σε YAML.

  2. 02

    Επικολλήστε το YAML ή το JSON σας στο πλαίσιο εισόδου.

  3. 03

    Αντιγράψτε το μετατραπέν αποτέλεσμα, ή διαβάστε το σφάλμα αν η είσοδος είναι μη έγκυρη.

What it does

This converter transforms YAML into JSON and JSON into YAML, in both directions. Pick the direction, paste your input, and copy the converted result or read a clear error if the input is malformed.

Everything is processed locally in your browser, so your data stays on your device.

How the two formats differ

YAML and JSON describe the same kind of data, but with different priorities. JSON is strict and compact, which suits APIs and machines; YAML is indentation-based and easier for people to read and edit, which is why it dominates configuration files.

Validation and the parser

Each conversion parses the source first, so malformed input is caught and reported with the reason and often the line, instead of silently producing a broken result. A successful conversion therefore also tells you the input was valid.

It uses the YAML 1.2 and 1.1 compatible parser from js-yaml, covering the features you meet in practice: mappings, sequences, scalars, anchors and multi-line strings.

Where it fits, and the comment caveat

This is exactly the glue you need around CI pipelines, Kubernetes and Docker Compose files, and APIs that speak JSON while your config is written in YAML. It lets you move between the two without hand-editing.

One thing to know: YAML comments are dropped, because JSON has no concept of comments, and converting back generates fresh YAML without them.

Συχνές ερωτήσεις

Ποια έκδοση YAML υποστηρίζεται;

Χρησιμοποιεί τον συμβατό με YAML 1.2 / 1.1 αναλυτή από το js-yaml, καλύπτοντας τα συνήθη χαρακτηριστικά: αντιστοιχίσεις, ακολουθίες, scalars, anchors και συμβολοσειρές πολλαπλών γραμμών.

Γιατί παίρνω σφάλμα;

Η είσοδος αναλύεται πριν τη μετατροπή, οπότε μη έγκυρο YAML ή JSON δείχνει ένα μήνυμα με τον λόγο και συχνά τη γραμμή, που σας βοηθά να εντοπίσετε γρήγορα το πρόβλημα.

Διατηρούνται τα σχόλια;

Όχι. Τα σχόλια YAML αφαιρούνται κατά τη μετατροπή επειδή το JSON δεν έχει σχόλια, και η μετατροπή πίσω παράγει νέο YAML χωρίς αυτά.

Μεταφορτώνονται τα δεδομένα μου;

Όχι. Η μετατροπή εκτελείται εξ ολοκλήρου στο πρόγραμμα περιήγησής σας, τίποτα από όσα επικολλάτε δεν φεύγει από τη συσκευή σας.

Πηγές

Ενσωματώστε αυτό το εργαλείο

Προσθέστε αυτό το εργαλείο στον δικό σας ιστότοπο. Αντιγράψτε το παρακάτω απόσπασμα, ενημερώνεται αυτόματα.

<iframe src="https://monu.tools/embed/el/yaml-json-converter" width="100%" height="640" style="border:1px solid #e5e5e5;border-radius:12px;max-width:680px" loading="lazy" title="Monu Tools"></iframe>

Σχετικά εργαλεία