YAML to JSON.

Converti YAML in JSON istantaneamente nel tuo browser. Veloce, gratuito e pensato per sviluppatori — senza upload, errori per riga e elaborazione completamente lato client.

Elaborato nel tuo browserNo upload, no signup

YAML input

0 lines · 0 chars

JSON output

0 lines · 0 bytesIndent: 2 spaces

What is YAML?

YAML is a human-friendly data serialization format used for configuration, CI pipelines, and Kubernetes manifests. It uses indentation (no braces or brackets) to express structure and supports maps, sequences, scalars, anchors, and multiline strings.

What is JSON?

JSON is the lingua franca of web APIs. It is strict about quoting strings and has only six value types — object, array, string, number, boolean, and null. Every YAML document can be expressed as JSON, but not the other way around.

YAML vs JSON.

YAML optimises for humans. JSON optimises for machines. YAML allows comments and anchors; JSON does not. YAML is whitespace-sensitive; JSON uses explicit { } and [ ]. When you convert from YAML to JSON, comments are dropped and YAML's flexible scalars (unquoted strings, dates) are emitted as proper JSON types where possible.

How to convert YAML to JSON.

  1. Paste your YAML into the left panel (or load the example).
  2. The converter runs on every keystroke — you should see JSON on the right immediately.
  3. Copy or download the result. To go the other way, click To YAML.

Common YAML conversion errors.

// Mixed indentation

user:
 name: John
  age: 25

YAML requires consistent indentation. The line above mixes two and four spaces, which is a parse error.

// Missing colon

title YAML without a colon

Every key in a mapping needs a : separator. Without one, YAML reads the line as a plain scalar and skips it.

// Tab characters

key:	value

YAML forbids tabs for indentation. Use spaces only. Most editors convert tabs to spaces automatically — but a stray one will break the file.

// Unsupported syntax

This converter supports the core YAML 1.2 spec. Custom tags and esoteric directives are not parsed.

Il tuo input viene elaborato localmente e non viene caricato. Verifica aprendo DevTools → Network.

YAML to JSON esempi.

// Oggetto semplice

// Oggetto annidato

// Array di elementi

Domande frequenti.

Il mio YAML viene inviato a un server?

No. La conversione viene eseguita interamente nel tuo browser con JavaScript. Apri la scheda rete — non vedrai richieste con i tuoi dati.

Il convertitore preserva i commenti?

JSON non ha sintassi per i commenti, quindi vengono rimossi durante la conversione.

Cosa succede se il mio YAML non è valido?

Vedrai un messaggio di errore con la riga esatta e la colonna, più un suggerimento per la correzione più probabile.

Posso caricare un file .yaml o .yml?

Sì. Trascina un file nel pannello di input o usa il pulsante di caricamento.

Quale dimensione di YAML posso convertire?

Non c'è un limite fisso, ma file molto grandi possono mettere in pausa brevemente l'interfaccia.

La conversione da YAML a JSON è sicura?

Sì — e la garanzia più forte è che i tuoi dati non lasciano mai il tuo browser.

Conversione YAML in JSON

YAML è un formato di dati leggibile dall'uomo utilizzato per file di configurazione, pipeline CI e manifesti Kubernetes. JSON è il formato universale per le API web, supportato nativamente da JavaScript. Questo strumento converte document YAML in strutture JSON valide.

Il convertitore preserva le strutture annidate, i tipi di dati e l'ordine delle chiavi. I commenti YAML vengono rimossi perché JSON non supporta i commenti. Le ancore e gli alias vengono risolti prima della conversione.

Quando convertire YAML in JSON

Quando è necessario convertire file di configurazione YAML in JSON per API web o applicazioni JavaScript.

Per l'analisi dei dati, la conversione consente di elaborare dati YAML con strumenti JSON come jq o JSONPath.

Dettagli della conversione

I mapping YAML vengono convertiti in oggetti JSON. Le sequenze YAML diventano array JSON. Gli scalari rimangono come stringhe, numeri o booleani in base al loro tipo YAML.

Per YAML multi-documento (con ---), solo il primo documento viene convertito. Per più documenti, separarli e convertirli individualmente.

Strumenti correlati.