Esta página aún no está traducida al español, así que la mostramos en inglés.

YAML to JSON Converter

Paste YAML — a Compose file, Kubernetes manifest or CI config — and get formatted JSON. Syntax errors are reported with the exact line and column.

Actualizado el
YAML indent
JSON indent
Open file

Both panes are editable — change either side and the other updates instantly.

Tus datos nunca salen de tu ordenador. Todo se procesa localmente en tu navegador.

Cómo usar: YAML to JSON

  1. Paste YAML into the YAML pane, open a .yaml/.yml file, or click Load sample.
  2. The JSON appears instantly. Choose 2-space, 4-space or tab indentation for the JSON output.
  3. If the YAML is invalid, the error message shows the line and column and highlights the spot.
  4. Click Copy or Download to save data.json.

What is YAML to JSON conversion?

YAML is designed for humans: indentation instead of braces, optional quotes and comments. JSON is designed for machines and APIs. Converting YAML to JSON lets you feed a config file to a tool or API that only speaks JSON, validate it against a JSON Schema, or simply check how a YAML parser actually interprets your indentation — which is the fastest way to find out why a value ended up in the wrong place.

What the converter supports

  • Anchors, aliases and merge keys — &defaults, *defaults and <<: *defaults (common in Docker Compose and GitLab CI) are expanded into plain JSON.
  • Multiple documents — files with several documents separated by --- (typical for Kubernetes) become a JSON array, one element per document.
  • Block scalars — | keeps line breaks, > folds them into spaces.
  • Comments are allowed in YAML but dropped in JSON, which has no comment syntax.

How values are typed (YAML 1.2)

The parser follows the YAML 1.2 core schema, the same rules as modern tools. Plain scalars become JSON types like this:

YAMLJSONNote
true, Falsetrue, falseBooleans
yes, on, NO"yes", "on", "NO"Strings in YAML 1.2 (booleans in old 1.1 parsers)
~, null, empty valuenull
0x1F, 0o17, 1e331, 15, 1000Numbers
2024-05-01"2024-05-01"Kept as a string
.inf, .nannullJSON has no infinity/NaN

Common YAML errors

Tabs for indentation are forbidden — use spaces. Inconsistent indentation (“bad indentation of a mapping entry”) happens when sibling keys don't line up. Unquoted colons — title: Note: read me — confuse the parser; wrap the value in quotes. Duplicate keys in the same mapping are reported as errors. Once converted, you can tidy the result with the JSON Formatter or generate types with JSON to TypeScript. For the reverse direction use JSON to YAML.

También se busca como: yml to json, convert yaml to json, yaml parser, yaml validator, yaml2json, yaml lint.

Herramientas que combinan con: YAML to JSON

  • CSV to JSON — Paste CSV or TSV and get a JSON array of objects.
  • JSON Schema Validator — Paste a schema and some JSON to see exactly which values break which rule — or generate a starting schema from example data.
  • JSONPath Tester — Type a JSONPath query and instantly see what it selects — with the exact path of each match.
  • OpenAPI / Swagger Validator — Paste an API specification to check it against the official OpenAPI schema, catch broken references and inconsistent path parameters, and see every endpoint at a glance.

Preguntas frecuentes

Does it support Docker Compose and Kubernetes files?
Yes. Anchors and << merge keys are resolved, and multi-document Kubernetes files separated by --- are returned as a JSON array.
Why is "yes" converted to a string and not true?
Under YAML 1.2, only true/false (in any capitalization) are booleans. yes, no, on and off were booleans in YAML 1.1, which caused many bugs, so modern parsers treat them as strings.
What happens to YAML comments?
They are removed, because JSON has no comment syntax. If you need to keep notes, store them as regular string fields.
Can I use this as a YAML validator?
Yes. If the YAML cannot be parsed you get the error reason with line and column, plus a highlighted excerpt — the same checks a YAML linter performs for syntax.
¿Puedo instalar YAML to JSON como aplicación web y utilizarla sin conexión?
Sí. YAML to JSON es una aplicación web instalable (PWA): se instala desde el navegador, no se descarga desde una tienda de aplicaciones. Haz clic en «Instalar aplicación» en la parte superior de esta página en Chrome o Edge (Windows, macOS, Linux, ChromeOS) o, en Android, utiliza «Compartir» → «Añadir a la pantalla de inicio» en iPhone y iPad, o «Archivo» → «Añadir al Dock» en Safari 17+ en un Mac. A continuación, se abrirá en su propia ventana con su propio icono y, como se ejecuta íntegramente en tu navegador, seguirá funcionando sin conexión. Firefox en el ordenador de sobremesa no permite instalar aplicaciones web. Cómo funciona la instalación.

Herramientas relacionadas