YAML to JSON Converter Free
Convert YAML configuration files to JSON online for free. Supports anchors, aliases, multi-line strings, and multi-document YAML. Powered by js-yaml — the same parser used in millions of Node.js projects. Data never leaves your browser.
YAML Input
JSON Output
Pro — batch convert files, JSON-to-YAML reverse, schema validation, API access
API access · Priority queue · Team workspace
How It Works
Paste Your YAML
Paste any valid YAML into the input editor — from a Kubernetes manifest, Docker Compose file, GitHub Actions workflow, Ansible playbook, CI/CD configuration, or any other YAML source. Click Sample YAML to load a realistic example with anchors, aliases, lists, and nested mappings.
Choose Options
Select indent size (2 spaces, 4 spaces, tab, or minified), enable multi-document mode to handle YAML files with multiple documents separated by --- on separate lines, and optionally sort JSON keys alphabetically for consistent, diffable output. Click Convert for instant results.
Copy or Download
Copy the JSON to clipboard with one click or download it as a .json file. Multi-document YAML produces a JSON array where each element is one document. The stats bar shows input size, output size, and the number of YAML documents parsed so you can verify the conversion is complete.
YAML to JSON Features
Full YAML 1.2 spec support powered by js-yaml
Anchors & Aliases
YAML anchors (&name) and aliases (*name) are fully supported. Anchors define reusable values, and aliases reference them — a common pattern in Kubernetes configs, CI/CD pipelines, and Docker Compose files. The converter resolves all aliases and produces the fully expanded JSON with no unresolved references.
Multi-Document YAML
YAML files can contain multiple documents separated by --- (three dashes on their own line). Enable multi-document mode to parse each document separately. The output is a JSON array where each element corresponds to one YAML document — ideal for Kubernetes manifests that bundle multiple resource definitions in one file.
Type Inference
YAML values are automatically typed: bare numbers become JSON numbers, true/false become JSON booleans, null/~ become JSON null, and quoted strings stay as strings even if they look numeric. ISO date strings are preserved as strings. This ensures the JSON output faithfully represents the YAML semantics.
Multi-line Strings
YAML block scalars using literal (|) and folded (>) styles are correctly converted to JSON strings with proper newline handling. Literal blocks preserve newlines exactly; folded blocks collapse newlines to spaces with a final newline. Both styles are common in CI/CD scripts, shell commands, and embedded configuration.
Sort Keys Option
Enable "Sort keys alphabetically" to produce JSON with keys in alphabetical order across all nested objects. This makes the output deterministic and diffable — two YAML files with the same data but different key ordering produce identical sorted JSON. Useful for comparing configurations, storing in version control, and schema comparison.
100% Private
js-yaml runs entirely in your browser. No YAML content is transmitted to any server. Safe for Kubernetes secrets files, CI/CD configs with API tokens, Ansible vault references, Docker Compose files with credentials, and any other configuration that contains sensitive values and must not leave your device.
Free vs Pro
| Feature | Free | Pro |
|---|---|---|
| YAML input size | Unlimited | Unlimited |
| Multi-document YAML | ||
| JSON to YAML (reverse) | — | |
| Batch file conversion | — | |
| JSON Schema validation | — | |
| REST API access | — |
Frequently Asked Questions
js-yaml implements the full YAML 1.2 specification, including anchors & aliases, merge keys (<<), multi-line string blocks (| literal, > folded), flow sequences and mappings, all standard types (strings, numbers, booleans, nulls, dates), and multi-document files. YAML 1.1 compatibility mode is also available for legacy configs that rely on older boolean handling (on/off/yes/no).
Enable the "Multi-document (---)" checkbox to parse YAML files containing multiple documents separated by ---. The output is a JSON array where each element corresponds to one YAML document in order. This is common in Kubernetes, where a single file might contain a Deployment, Service, and ConfigMap as three separate YAML documents.
No. js-yaml runs entirely as a client-side JavaScript library in your browser. No data is uploaded, transmitted, or stored. This makes it safe for Kubernetes secrets, CI/CD configs containing API tokens, Ansible vault files, and any other YAML that contains sensitive configuration values.
YAML ("YAML Ain't Markup Language") was designed for human readability and ease of hand-editing. Indentation-based structure eliminates closing braces and quotes from simple values, making configuration files cleaner and shorter than JSON equivalents. The tradeoff is that indentation errors (mixing tabs and spaces, wrong indent level) can cause parse failures — which is why a converter like this is useful when you need YAML data in JSON format for APIs or databases that expect JSON.