Cette page n’est pas encore traduite en français : elle s’affiche en anglais.

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.

Mis à jour le
YAML indent
JSON indent
Open file

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

Vos données ne quittent jamais votre ordinateur. Tout le traitement se fait localement dans votre navigateur.

Comment utiliser : 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.

Aussi recherché comme : yml to json, convert yaml to json, yaml parser, yaml validator, yaml2json, yaml lint.

Outils complémentaires : 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.

Questions fréquentes

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.
Puis-je installer YAML to JSON en tant qu’application web et l’utiliser hors ligne ?
Oui. YAML to JSON est une application web installable (PWA) : elle s’installe depuis votre navigateur, sans passer par une boutique d’applications. Cliquez sur « Installer l’application » en haut de cette page dans Chrome ou Edge (Windows, macOS, Linux, ChromeOS) ; sur Android, utilisez « Partager » → « Ajouter à l’écran d’accueil » sur iPhone et iPad ; ou « Fichier » → « Ajouter au Dock » dans Safari 17+ sur Mac. L’application s’ouvre alors dans sa propre fenêtre avec sa propre icône, et comme elle s’exécute entièrement dans votre navigateur, elle continue de fonctionner hors ligne. Firefox sur ordinateur de bureau ne permet pas d’installer d’applications web. Comment fonctionne l’installation.

Outils similaires