YAML ↔ JSON Converter

🔒 Conversion runs in your browser — nothing is uploaded.
0 chars · 0 lines
0 chars · 0 lines

About the YAML ↔ JSON Converter

This free online tool converts YAML to JSON and JSON to YAML directly in your browser. No files are sent to any server — all processing happens client-side using the battle-tested js-yaml library. It supports the full YAML 1.2 spec including anchors, aliases, multi-line strings, and nested structures, making it ideal for Kubernetes manifests, Docker Compose files, OpenAPI schemas, Helm charts, Ansible playbooks, and CI/CD configuration files.

JSON output is pretty-printed with 2-space indentation for readability. YAML output uses standard indentation. Error messages include line numbers when available so you can quickly locate and fix syntax problems.

Frequently Asked Questions

Yes. Paste any Kubernetes YAML manifest — Deployments, Services, ConfigMaps, and more — and click Convert. The tool handles multi-key nested objects and lists correctly. Note that multi-document YAML files (separated by ---) will only convert the first document; split them manually if needed.
Yes. js-yaml fully resolves YAML anchors (&anchor) and aliases (*alias) before producing JSON output, so the resulting JSON contains all values fully expanded.
YAML supports multiple documents in a single file, separated by ---. JSON has no equivalent concept, so only the first document is converted. The yellow info note appears to let you know. To convert subsequent documents, remove the preceding --- blocks and convert each document separately.
Nothing is uploaded. The converter runs entirely in your browser using JavaScript. Your YAML or JSON never leaves your device, making it safe to use with internal configuration files, secrets references, or proprietary schemas.
The JSON specification discourages duplicate keys but does not forbid them. JavaScript's JSON.parse silently keeps the last value for each duplicated key. The tool detects duplicates and shows an informational note so you are aware that earlier values were overwritten.
Files up to several megabytes work fine in modern browsers. For inputs over 1 MB the tool shows a yellow warning that conversion may be slow, but still attempts it. For very large files, consider splitting them or using a command-line tool like yq or python -c "import yaml,json;...".
Copied!