File & Format Converters · Free tool
YAML ↔ JSON Converter
Quickly convert YAML to JSON or JSON to YAML online. Paste on one side and copy the result instantly for configs or data — free tool that runs right in your browser.
YAML input
JSON output
Supports scalars, nested mappings, and sequences with block (-) or flow ([ ], { }) syntax. Tabs are not valid indentation in YAML.
Advertisement
What it does
A free two-way YAML ↔ JSON converter. Paste YAML to get JSON, or paste JSON to get clean YAML — then hit Swap to bounce in the other direction with the output promoted to the new input. Supports nested mappings, block and flow sequences, strings, numbers, booleans, and null.
YAML is the config-file default for Kubernetes, GitHub Actions, Docker Compose, Ansible, and most dev tooling. JSON is the default for APIs and JavaScript. Translating between them is an everyday task. Tip: YAML disallows tab characters in indentation — if a paste errors, check for mixed tabs and spaces.
Embed this tool on your siteShow snippetHide
Paste this snippet into any page. Loads on-demand (lazy), no tracking scripts, and sized to most dashboards. Replace the height to fit your layout.
<iframe src="https://freetoolarena.com/embed/yaml-json-converter" width="100%" height="720" frameborder="0" loading="lazy" title="YAML ↔ JSON Converter" style="border:1px solid #e2e8f0;border-radius:12px;max-width:720px;"></iframe>How to use it
- Pick the direction you want: YAML → JSON or JSON → YAML.
- Paste or type in the top box.
- Read the output instantly in the bottom box — errors show inline.
- Hit Swap to flip direction and continue iterating.
When to use this tool
- Translating Kubernetes manifests between team conventions (some prefer JSON, others YAML).
- Converting GitHub Actions workflow YAML to JSON for programmatic generation.
- Migrating Docker Compose YAML to a JSON-based orchestration tool.
- Translating an OpenAPI spec between YAML and JSON formats.
When not to use it
- When you need to preserve YAML comments — convert manually or use yq.
- Documents using YAML 1.1 quirks that may not be detected — verify with explicit tests.
- Very large config files (5MB+) — browser performance suffers.
Common use cases
- Convert kubectl-output JSON to YAML for committing to a Git repo as a manifest.
- Translate a docker-compose.yml to JSON for parsing in a Node.js automation script.
- Move OpenAPI 3.0 specs between YAML (human edits) and JSON (build-time consumption).
- Cross-reference a Helm chart's values.yaml against the schema's JSON representation.
Frequently asked questions
- Does it preserve comments?
- YAML-to-JSON loses comments (JSON doesn't support them). JSON-to-YAML has no comments to preserve. For comment-critical conversions, use a tool like yq which can preserve some metadata.
- What about YAML anchors and aliases?
- The converter expands anchors and aliases during YAML-to-JSON conversion — the resulting JSON has each referenced value inlined.
- Which YAML spec?
- YAML 1.2 — the current standard. This handles the 'Norway problem' (no as boolean) correctly, unlike older 1.1 parsers.
- Max file size?
- Up to about 2 MB for smooth browser performance. Larger documents may cause UI lag since parsing happens client-side.
- Why use YAML over JSON?
- YAML pros: human-readable for config files, supports comments, less syntactic noise (no quotes around keys, no commas at line ends), standard for Kubernetes/Docker Compose/GitHub Actions/Ansible. JSON pros: faster to parse, strict syntax (less ambiguity), universal language support, native to JavaScript. Use YAML for configuration humans will edit by hand; use JSON for API payloads, data interchange, and programmatic generation. Many systems support both: Kubernetes accepts JSON manifests, but YAML is the convention. JSON is faster to parse but YAML is more pleasant to read.
- What's the difference between YAML 1.1 and 1.2?
- YAML 1.1 (2005): 'yes', 'no', 'on', 'off' parse as booleans. The famous 'Norway problem': country code 'NO' parsed as false, breaking config files. YAML 1.2 (2009): only 'true' and 'false' (case-insensitive) parse as booleans; 'yes'/'no' stay as strings. Most modern parsers (PyYAML 5+, js-yaml 4+) default to 1.2 mode. If parsing legacy YAML, you may need explicit 1.1 mode or quote ambiguous values: country: 'NO' vs country: NO.
Advertisement
Learn more
Guides about this topic
- Developers & Technical · GuideHow to convert YAML to JSONConvert YAML to JSON online free, handling tricky anchors and precision instantly. No sign-up needed for clean, round-tripped output.
- Using Our Tools · GuideHow to merge PDFsMerge PDFs free and safely directly in your browser—no watermarks, sign-up, or uploads. Combine documents instantly with our online tool, no download required.
- Using Our Tools · GuideHow to split a PDFSplit a PDF by pages or ranges without uploading to a server. Clear steps, common pitfalls, and a free tool you can use instantly in your browser.
- Design & Media · GuideHow to compress images without losing qualityCompress images without losing quality — pick the right format, dimensions, and quality settings to shrink files fast. Free online guide, no signup.
- Design & Media · GuideHow to resize images without losing qualityResize images without quality loss — Lanczos vs bicubic, downscale tips, AI upscaling limits, web/print sizes, batch tools. Free guide, no sign-up.
- Design & Media · GuideHow to choose image formatsAnalyze JPG, PNG, WebP, AVIF, and SVG trade-offs with our free, browser-only guide. Instant format recommendations for quality, size, and compatibility.
Explore more file & format converters tools
- HEIC to PDFCombine iPhone HEIC photos into a single multi-page PDF. Reorder pages, pick A4/Letter or fit-to-image. Browser-only, no uploads, no watermarks.
- HEIC to WebPConvert iPhone HEIC photos to WebP — 25-35% smaller than JPG at the same quality. Universal modern-browser support. Batch in-browser, no uploads.
- HEIC to PNGConvert iPhone HEIC photos to lossless PNG right in your browser. Pixel-perfect output for editing pipelines and archival. Batch supported, no uploads.
- Timestamp ConverterTransform Unix timestamps to ISO 8601 dates and back instantly. Auto-detects milliseconds vs seconds for precise conversion with no sign-up.
- Text to Binary ConverterConvert any text to/from binary using UTF-8 codepoints. Multi-byte chars (emoji, non-Latin) handled correctly.
- Binary ConverterEdit any field to instantly transform numbers across all four bases in your browser. Use this free, ad-free live conversion tool with no sign-up.