Herramientas Guías
developer Gratis Sin registro

Validador y formateador YAML

Valide la sintaxis YAML y conviértala a JSON formateado — completamente en su navegador.

Cargando la herramienta…

Acerca de esta herramienta

Pegue YAML y compruebe instantáneamente si es válido. El analizador incorporado maneja escalares (cadenas, números, booleanos, null), objetos anidados mediante sangría y secuencias con el prefijo -. Cambie a la vista JSON para ver su YAML convertido a JSON formateado. Los mensajes de error muestran el número de línea para una depuración rápida.

Cómo usar

  1. 1 Pegue su YAML en el área de texto de entrada.
  2. 2 Haga clic en 'Validar' para verificar errores de sintaxis.
  3. 3 Haga clic en 'Convertir a JSON' para ver la representación JSON.
  4. 4 Corrija los errores mostrados — el mensaje de error incluye el número de línea.

What YAML is and why indentation breaks it

YAML ("YAML Ain't Markup Language") is a human-readable data format used for configuration files almost everywhere — Docker Compose, Kubernetes, GitHub Actions, Ansible, and countless app settings. Its appeal is that it looks clean: no braces, no quotes most of the time, just keys, values, and structure expressed through indentation. That same strength is its biggest trap. Because YAML uses leading spaces to show nesting, a single misaligned space or a stray tab can completely change what your file means — or stop it from parsing at all. This validator reads your YAML, builds the same nested structure a parser would, and tells you whether it is well-formed, pointing to the line where it fails.

How the validator reads your file

The tool walks your YAML line by line. It first strips out blank lines and comments — including inline comments after a #, while being careful to leave a # alone when it sits inside a quoted string. For each remaining line it records the indentation depth, then assembles the data: a line like key: value becomes a mapping entry, a line starting with - becomes a list item, and deeper-indented lines become children of the line above. Scalar values are interpreted with their natural types, so true and yes become booleans, 30 becomes a number, ~ and null become null, and quoted text stays a string. If a line is indented inconsistently — claiming to be a child but not lining up with anything — the parser raises an error naming the offending line number.

A worked example

Consider this input:

YAMLParsed meaning
name: John Doestring "John Doe"
age: 30number 30
active: trueboolean true
tags:
  - admin
  - user
list ["admin", "user"]
address:
  city: Seoul
nested object {city: "Seoul"}

Press Convert to JSON and the tool emits the equivalent JSON, which makes the structure explicit with braces and brackets — useful both for confirming you got the nesting right and for feeding the data to a system that expects JSON. The age appears as a bare 30, not "30", confirming YAML inferred a number.

Use cases

  • Catching CI/CD failures before you push. A broken GitHub Actions or GitLab CI file fails the whole pipeline. Validating locally saves a round-trip of failed builds.
  • Debugging Kubernetes and Docker Compose manifests. These are deeply nested; one wrong indent on a volumes or env block silently drops settings.
  • Converting config to JSON. When an API or script wants JSON but your data lives in YAML, the converter gives you a clean translation.
  • Teaching and learning YAML. Seeing how indentation maps to objects and lists makes the rules concrete.

Common mistakes this catches

  • Tabs instead of spaces. YAML forbids tabs for indentation. They look identical to spaces in many editors but cause parse errors — set your editor to insert spaces.
  • Inconsistent nesting depth. If sibling keys are indented by different amounts, the structure becomes ambiguous. The validator flags the line where the indentation stops making sense.
  • Unquoted special values. A version number like 1.10 may be read as the number 1.1, and a country code like NO can become the boolean false. Quote values you intend to stay strings.
  • Forgetting the space after the colon. key:value is not a mapping; YAML needs key: value with a space. This is one of the most frequent typos.

Scope and privacy

This is a lightweight structural validator built for the common YAML you write by hand: mappings, lists, nested objects, scalars with type inference, and block text. It is not a full implementation of every corner of the YAML specification — exotic features like anchors, aliases, and multi-document streams are outside its scope — so for those, treat a clean result as a strong sanity check rather than a formal guarantee. Everything runs in your browser: your YAML is parsed locally and never uploaded, so it is safe to paste configuration that contains internal hostnames or settings.

Preguntas frecuentes

{# Alpine.js — self-hosted. (The previous jsdelivr CDN tag had a stale SRI integrity hash, so the browser refused to run it and window.Alpine was never defined — silently breaking every FAQ accordion and Alpine tool.) #}