⚙️ Data Tools

YAML to JSON Converter

Convert between YAML and JSON formats instantly. Perfect for DevOps, Kubernetes configs, CI/CD pipelines, and configuration management.

YAML Input

1 lines

JSON Output

JSON output will appear here...

Common Use Cases

☸️

Kubernetes

Convert K8s YAML manifests to JSON for API calls or vice versa for human editing.

🔧

CI/CD Pipelines

Transform GitHub Actions, GitLab CI, or CircleCI configs between formats.

📦

Docker Compose

Convert docker-compose.yml files to JSON for programmatic manipulation.

Serverless

Convert serverless.yml configs to JSON for AWS CloudFormation integration.

🔐

Ansible

Transform Ansible playbooks and inventory files between YAML and JSON.

📝

Config Files

Convert application configs for tools that prefer one format over another.

⚠️

Note on YAML Parsing

This tool uses a simplified YAML parser that handles common cases. For complex YAML features like anchors, aliases, or multi-line strings, consider using a dedicated YAML library.

YAML Gotchas Worth Knowing Before You Convert

Since version 1.2, YAML is formally a superset of JSON, which means every valid JSON document is already valid YAML. Converting in that direction is straightforward. Coming the other way is where the surprises live, because YAML tries hard to guess what you meant and occasionally guesses wrong.

The Norway problem

This is the famous one. Under YAML 1.1, the unquoted words yes, no, on, and off are boolean literals. A list of country codes containing NO therefore parses as the boolean false rather than the string Norway. A configuration flag written as off becomes a boolean rather than a mode name. YAML 1.2 narrowed booleans to true and false only, but a great many parsers in active use still implement 1.1 behavior. So the safe practice is to quote any short string that could be read as a word of agreement.

Numbers that aren't the number you typed

A value with a leading zero can be interpreted as octal, which turns a zip code or a zero-padded version segment into an unrelated decimal number. Version strings such as 1.2.3 stay strings because they have two dots, but 1.20 becomes the number 1.2 and loses the trailing zero. Under older parsers, a value shaped like 12:30 can be read as a sexagesimal number rather than a time. Quoting is again the fix, and it costs nothing.

Features with no JSON equivalent

Several YAML constructs simply don't survive conversion. Anchors and aliases let one block be defined once and referenced elsewhere, and merge keys let a mapping inherit from another. Both must be expanded into their full form on the way to JSON, so the output is larger and the shared structure is duplicated. A single YAML file can also contain several documents separated by triple dashes, whereas a JSON file holds exactly one value. So multi-document streams have to be split or wrapped in an array.

Comments are the loss people notice most. YAML supports them and JSON doesn't, so every explanatory note in a configuration file disappears on conversion. If the YAML is the canonical source, keep it that way and treat the JSON as generated output rather than something to edit and convert back.

Indentation rules

YAML uses indentation for structure and forbids tab characters entirely for that purpose. An editor configured to insert tabs will produce a file that fails to parse with an error that rarely points at the real cause. If a document refuses to load and looks correct, checking for tab characters is usually the fastest diagnosis.