Convert YAML configuration files and data to JSON format. Supports the full YAML 1.2 specification including nested objects, arrays, multi-line strings, YAML anchors and aliases, and type coercion. Useful for adapting Kubernetes configs, Docker Compose files, CI/CD configurations, and other YAML-based tools to JSON-based APIs or databases.
Paste your YAML
Paste any valid YAML content — configuration files, data definitions, Kubernetes manifests, GitHub Actions workflows, or custom data files.
Click Convert
The js-yaml library parses your YAML with full 1.2 spec support. Anchors and aliases are resolved, multi-line strings are concatenated, and types are inferred (numbers, booleans, null).
Copy or download the JSON
The output is formatted JSON with 2-space indentation. Copy to clipboard or download as a .json file.
Validate the output
Use our JSON Formatter to double-check the structure matches what you expected, especially for complex YAML with anchors or merge keys.
JSON is the de facto standard for REST APIs, browser applications, and many database systems. YAML is preferred for configuration files because it's more human-readable. You might convert YAML to JSON when: submitting data to an API that only accepts JSON, storing YAML config in a JSON database, working in an environment where YAML parsers aren't available, or debugging YAML structure by viewing it as JSON.
Yes. YAML anchors (&anchor) and aliases (*alias) are fully resolved in the output JSON. The referenced values are expanded in place. YAML merge keys (<<) are also supported — they merge properties from referenced objects. This means complex YAML with reused sections converts correctly to JSON.
YAML has two multi-line string styles: literal (|) preserves newlines, and folded (>) converts newlines to spaces. The js-yaml parser handles both correctly. Literal blocks become JSON strings with \n characters; folded blocks become JSON strings with spaces. This is the standard YAML specification behavior.
This tool converts YAML to JSON only. For JSON to YAML, use an editor like VS Code which supports "Convert to YAML" via extensions, or a dedicated JSON-to-YAML converter. The js-yaml library used here supports both directions, and we plan to add a JSON-to-YAML tool in the future.
YAML 1.1 (used by PyYAML and many older tools) treats values like "yes", "no", "on", "off" as booleans. YAML 1.2 (the current standard) only treats "true" and "false" as booleans. This tool uses js-yaml which defaults to YAML 1.2 behavior. If your YAML uses "yes/no" for booleans, they'll be treated as strings in the JSON output.
Something not working? Report a bug