YAML to JSON Converter parses a YAML document and emits the equivalent JSON. Paste a Kubernetes manifest, a Docker Compose file, a GitHub Actions workflow, or an Ansible playbook, and you get back formatted JSON with the same structure — mappings become objects, sequences become arrays, and scalars are resolved to strings, numbers, booleans, or null according to the YAML core schema.
The parser handles the parts of YAML that trip up naive converters. Anchors and aliases are resolved, so a `*defaults` reference expands into the value it points at. Merge keys (`<<: *base`) are flattened into the target mapping, with explicit keys taking precedence as the spec requires. Literal (`|`) and folded (`>`) block scalars keep or fold their newlines correctly, including the strip and keep chomping indicators. Multi-document streams separated by `---` come out as a JSON array of documents.
Everything runs in your browser. Config files routinely carry internal hostnames, cluster names, image registries, and occasionally a secret someone forgot to move into a vault, so nothing you paste is uploaded, logged, or stored. You can also sort keys alphabetically for easier diffing, choose 2-space, 4-space, or minified output, and keep every plain scalar as a string when your downstream consumer is strict about types.
Paste any YAML document into the input panel — a manifest, a compose file, a CI pipeline, or an application config. Click Load Sample to start from a realistic Kubernetes Deployment.
Pick 2-space, 4-space, or minified JSON. Enable Sort keys for diff-friendly output, or Keep strings when you want ports and version numbers to stay text instead of becoming numbers.
Click Convert. If the YAML has a syntax problem — a tab used for indentation, an unclosed quote, an alias with no matching anchor — the error is reported with the exact line number.
Copy the result to your clipboard or download it as a .json file, ready to feed into an API client, a test fixture, or a script.
Resolves &anchor definitions, *alias references, and << merge keys so shared config blocks expand into complete JSON objects
Literal (|) and folded (>) blocks convert correctly, including explicit indentation digits and the strip (-) and keep (+) chomping indicators
YAML files split by --- into several documents, common in Kubernetes, are returned as a JSON array with one entry per document
Syntax problems report the exact source line — tabs used as indentation, unterminated quotes, bad indentation, or unknown aliases
0 comments
No comments yet. Be the first to share your thoughts!