YAML to JSON Converter
Convert YAML data to JSON format instantly. Paste text or upload a .yaml file.
No data sent to serverRelated Tools
What is YAML to JSON?
YAML (YAML Ain't Markup Language) is the standard config format for modern DevOps — Kubernetes, Docker Compose, GitHub Actions, Ansible, dbt. JSON is the standard data format for APIs and programming. Converting YAML → JSON is needed when you want to consume config files in code, validate against JSON Schema, or integrate with JSON-only tools.
Common scenarios: parsing Helm values.yaml in CI scripts, validating Kubernetes manifests with JSON Schema validators, OpenAPI spec consumption (most tools require JSON), config file unit tests (easier to compare structured JSON), API request bodies from YAML templates.
Conversion example
# YAML
name: myapp
ports:
- 80
- 443
env:
DEBUG: false
PORT: 3000
# Comments are preserved during edit but
# stripped during YAML→JSON (JSON has no comments)
# JSON
{
"name": "myapp",
"ports": [80, 443],
"env": { "DEBUG": false, "PORT": 3000 }
}What's lost in conversion
- Comments: JSON has no comment syntax — all
#lines are stripped - Anchors / aliases:
&name/*nameare inlined (data preserved, structure flattened) - Multi-line string formatting:
|and>styles become regular JSON strings with\nescapes - Document separators:
---markers between multiple YAML docs are not represented in JSON (need to convert each separately) - Tags:
!!str,!!floatexplicit type tags become inferred JSON types
Watch out for type coercion
YAML's permissive type inference can produce surprises that show up in JSON output:
- Booleans:
NO,yes,off,onbecome true/false (Norway problem) — quote them as strings to preserve text - Numbers:
1.0becomes number 1.0; quote as"1.0"if you mean version string - Octals:
0644in YAML 1.1 becomes 420 decimal (file permissions trap) - Null: empty values,
null,~,NULLall become JSON null - Dates: ISO date strings may be parsed as Date objects; quote to keep as string
How to Use
- Paste YAML data, or upload a
.yaml/.ymlfile. - Click Convert.
- Review the JSON — verify type coercions (especially for boolean-looking strings, version numbers).
- Copy or download as
.json.
Privacy: Conversion runs in your browser via js-yaml. No upload.
FAQ
Are YAML anchors and aliases supported?
Yes — js-yaml handles anchors (&name), aliases (*name), and merge keys (<<) correctly. They're inlined during conversion (data preserved, references resolved).
Does it support multi-document YAML?
Currently only the first document is converted. For multi-document YAML (separated by ---), split into separate documents and convert each.
Why is my NO string showing as false in JSON?
YAML's Norway problem — it coerces NO, yes, off, on to booleans. Quote them as "NO", "yes" in your YAML source to preserve as strings.
My version "1.0" became a number — how to keep as string?
Quote it: version: "1.0" instead of version: 1.0. Without quotes, YAML treats it as a number.
What if my YAML has parse errors?
Common errors: tabs in indentation (only spaces allowed), missing colons after keys, inconsistent indent levels. Use a YAML linter (yamllint) to identify issues.
Why does the JSON output not have comments?
JSON spec doesn't allow comments. They're stripped during conversion. For "JSON with comments", use JSONC (VS Code's flavor) — but strict JSON parsers will reject it.
⚠️ Reference Only
Output is generated based on your input and is provided for reference. Results may vary depending on your specific use case, edge cases, or environment-specific behavior. We do not guarantee accuracy of conversions, validations, or computed values.
Always verify critical outputs against official documentation or production environments. We are not responsible for any decisions or losses based on these tool results.