Waiting for YAML input
Paste YAML on the left or load the sample to see JSON instantly.
Instantly clean, validate, and inspect web payloads
Paste YAML on the left or load the sample to see JSON instantly.
Convert YAML — Kubernetes manifests, CI workflows, Docker Compose files, or any config — into formatted JSON. PrettyJSON parses the YAML with js-yaml, resolving nested maps, sequences, and anchor references, then pretty-prints the result with 2-space indentation. It is what you reach for when a tool or API needs JSON but your source of truth is YAML, and it runs fully in the browser.
&anchor and *alias references resolve to their concrete values, so the JSON holds fully materialized data with nothing left to dereference.
Unquoted 3.10 is read as the number 3.1 and leading zeros can drop — quote any value you need kept verbatim.
A bad indent, a stray tab, or an unclosed quote is reported with the line it failed on, not a silent empty result.
A quick walkthrough and the details that matter.
YAML features that do not exist in JSON are resolved during parsing. Anchors (&name) and aliases (*name) are expanded into their concrete values, so the resulting JSON contains the fully materialized data with no references left behind. Nested mappings become nested objects and sequences become arrays.
A few YAML behaviors surprise people. Unquoted values are coerced by type, so 3.10 becomes the number 3.1 and a leading-zero value may be read as a number — quote a field in the YAML if it must stay a string. This converter also expects a single YAML document: files that contain multiple sections separated by --- should be converted one document at a time.
A before-and-after using sample YAML.
service: api
replicas: 3
ports:
- 80
- 443
env:
TIER: prod{
"service": "api",
"replicas": 3,
"ports": [
80,
443
],
"env": {
"TIER": "prod"
}
}Common questions about converting YAML to JSON.
Yes. Nested mappings, sequences (lists), and scalar values are parsed and converted into the equivalent nested JSON objects and arrays.
Yes. Anchors (&) and aliases (*) are expanded during parsing, so the JSON output contains the fully resolved values rather than references.
No. The converter expects a single YAML document. If your file separates sections with ---, convert each document one at a time.
No. Parsing and conversion run in your browser, so manifests that contain secrets or internal configuration never leave your machine.