Convert between YAML and JSON in either direction. Preserves types, resolves anchors, reports line-accurate errors, and shows key/depth stats. All processing happens in your browser.
YAML (YAML Ain't Markup Language) and JSON (JavaScript Object Notation) represent the same data model — scalars, sequences, mappings — with different syntax. YAML 1.2 is a strict superset of JSON, which is why every valid JSON document is also a valid YAML document. Use YAML when humans write and edit the file (Kubernetes, Docker Compose, CI pipelines). Use JSON when machines produce and consume it (REST APIs, log events, RPC payloads).
YAML is the de facto configuration format for Docker Compose, Kubernetes, GitHub Actions, GitLab CI, Ansible, Helm charts, CloudFormation, and OpenAPI/Swagger specs. The indentation-based syntax, comment support, and anchor/alias feature (for DRY configs) all favor human authorship.
JSON is the standard for REST/GraphQL payloads, web storage (localStorage, IndexedDB), configuration consumed by programs (package.json, tsconfig.json), and log events (structured logging, CloudWatch, Datadog). Every modern language has built-in parsers; strict syntax and zero ambiguity make it safe for machine-to-machine exchange.
Convert YAML to JSON when you need to feed a config file to an API or a tool that expects JSON (e.g., sending a Kubernetes manifest to the API server as JSON, or shipping a CI workflow definition to a validation webhook). Convert JSON to YAML when a human needs to review, diff, or hand-edit a machine-produced artifact (e.g., reviewing a Terraform plan output or an OpenAPI spec generated from code annotations).
A browser-based converter is fast and private, but it is the wrong tool for several common workflows:
yq (v4+), js-yaml, or python -c "import yaml, json; print(json.dumps(yaml.safe_load(open(...))))" in a shell script.kubeval or kubectl apply --dry-run=server. For OpenAPI, use spectral lint. For JSON Schema, use ajv or jsonschema (Python).---. This tool converts the first document; for full stream handling, pipe through yq eval-all or split manually.&name) and aliases (*name) are resolved during conversion because JSON has no equivalent. YAML → JSON → YAML flattens duplicates. Keep anchor-heavy files in a YAML-native workflow.sops, Vault, or cloud-native secret managers and keep plaintext off your screen.The top three causes, in order: (1) tabs mixed with spaces — YAML 1.2 forbids tab characters in indentation, use two spaces consistently, (2) unquoted strings that look like booleans/numbers — values like "yes", "no", "on", "off", "1.10" get coerced unless quoted, (3) trailing spaces after the key colon — "key: value" is valid, "key : value" is a common typo that still parses but breaks some strict parsers. This tool reports line numbers for every error so you can jump straight to the problem.
Anchors and aliases are resolved (expanded) during conversion to JSON because JSON has no equivalent syntax. If you convert YAML → JSON → YAML, the output will be flattened — every alias becomes a duplicated literal value. To preserve anchor structure, keep a YAML-native workflow (edit YAML directly, validate with yamllint) instead of round-tripping through JSON.
For straight conversion, yes — the output matches `yq -o=json` for standard inputs. What this tool does NOT do: jq-style queries, in-place file edits, merge operations, or schema validation. For CLI workflows (CI pipelines, batch conversion of hundreds of files), install `yq` (v4+). For schema validation against a spec like Kubernetes or OpenAPI, use `kubeval`, `kube-score`, or `spectral`.
YAML supports `#` line comments; JSON (per RFC 8259) does not. Converting YAML with comments to JSON silently drops the comments. If you need to preserve annotation-like metadata across a conversion, move it into a dedicated field (e.g., `_comment: "note"` or `description: "note"`) that survives as actual data.
YAML auto-detects types from unquoted values — "123" becomes an integer, "true" becomes a boolean. When converting to JSON, the tool preserves the detected type. If your YAML had `version: 1.10` and the JSON shows `"version": 1.1`, that is a type coercion (float) stripping trailing zeros. To keep the literal string, quote it in YAML: `version: "1.10"`.
The converter handles the first document by default. Multi-document YAML (common in Kubernetes manifests that bundle Deployment + Service + ConfigMap) requires splitting on `---` and converting each block separately, then wrapping the JSON outputs in an array. For automation across many manifests, use `yq eval-all` or `kustomize build | yq`.
Yes. Conversion runs entirely in JavaScript in your browser — no network request, no logging. This matters for YAML files that often contain cluster names, S3 bucket paths, internal hostnames, and service-account references. You can disconnect from the internet and the tool still works.