Esta página ainda não foi traduzida para o português, por isso aparece em 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.

Atualizado em
YAML indent
JSON indent
Open file

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

Seus dados nunca saem do seu computador. Todo o processamento acontece localmente no navegador.

Como 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.

Também pesquisado como: yml to json, convert yaml to json, yaml parser, yaml validator, yaml2json, yaml lint.

Ferramentas que combinam com: 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.

Perguntas frequentes

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.
Posso instalar o YAML to JSON como um aplicativo da web e usá-lo offline?
Sim. O YAML to JSON é um aplicativo da web instalável (PWA) — instalado a partir do seu navegador, não baixado de uma loja de aplicativos. Clique em “Instalar aplicativo” na parte superior desta página no Chrome ou no Edge (Windows, macOS, Linux, ChromeOS) ou, no Android, use “Compartilhar” → “Adicionar à tela inicial” no iPhone e no iPad, ou “Arquivo” → “Adicionar ao Dock” no Safari 17+ em um Mac. Em seguida, ela se abre em uma janela própria com seu próprio ícone e, como é executada inteiramente no seu navegador, continua funcionando offline. O Firefox no desktop não permite a instalação de aplicativos da web. Como funciona a instalação.

Ferramentas relacionadas