YAML to JSON Converter
Paste YAML or drop a .yaml/.yml file and get correctly-typed JSON instantly, locked to the YAML to JSON direction, with everything processed locally in the browser.
What it does
- Locked to the YAML to JSON direction with both formats pre-selected
- Correct type inference exposes implicit YAML typing surprises
- Pretty (2-space) or minified JSON output you can copy or download
- Runs locally, so Kubernetes secrets and credentials never leave the tab
This tool converts YAML to JSON entirely in your browser, so the config never leaves your machine and nothing is uploaded to a server. Developers and DevOps engineers reach for this when they need to feed a human-friendly config (Kubernetes manifests, Helm values, Docker Compose, GitHub Actions, Ansible) into something that only speaks JSON: an API, a JSON Schema validator, or a JS/TS app. Because that YAML so often holds API keys, kubeconfig data, internal hostnames, and database credentials, pasting it into a stranger's server is a real compliance problem, which is exactly the problem this page removes.
What this conversion actually does (and does NOT do)
YAML to JSON is a lossy conversion, and being honest about that up front saves you from silent surprises. JSON has no comment syntax, so every # comment in your YAML is stripped and is unrecoverable in the output. YAML anchors (&) and aliases (*) are resolved and expanded inline, which means every referenced value gets duplicated everywhere it was aliased, because JSON has no concept of references or deduplication. Merge keys (<<) are flattened the same way. YAML block scalars (| literal and > folded) become ordinary JSON strings with their line breaks encoded as \n escapes, so the visual formatting intent is gone even though the content survives.
Two more things worth knowing. Multi-document YAML separated by --- has no single JSON equivalent, so it is split and typically emitted as a JSON array with one element per document (the document-end markers ... are dropped). And JSON forces explicit typing and quoting, which surfaces YAML's implicit-typing surprises: the so-called Norway problem, where unquoted no, yes, on, and off are read as booleans, and version-like or leading-zero values such as 1.20 get coerced. The JSON simply makes the real parsed types visible. Note the direction matters: JSON is a strict subset of YAML, so the reverse trip (JSON to YAML) is always lossless while YAML to JSON is not.
When to choose YAML to JSON vs keeping YAML
Choose YAML to JSON when you are feeding config into an API, a JSON Schema validator, a JS/TS application, or any tool that only accepts JSON. Keep the data as YAML when humans need to read and edit it, which is why Kubernetes manifests and Compose files live as YAML in the first place. Expect the JSON to be larger in bytes than the indentation-based YAML, because braces, brackets, and quotes add overhead, so pick minified output when size matters and pretty output when a human will read it. If you later need to go back, the multi-direction YAML / JSON / TOML converter handles JSON to YAML and TOML in either direction.
How to convert YAML to JSON
- Open the converter — the input and output formats are already pre-selected to YAML and JSON for this direction.
- Paste your YAML, or drop a .yaml or .yml file into the input area.
- Click convert and the correctly-typed JSON appears in the output panel.
- Copy the result to your clipboard or download it as a .json file.
No upload. It runs on your device.
The YAML parse and JSON serialization both happen in Rust compiled to WebAssembly, running inside your browser tab. There are zero network requests for the conversion, the tool works fully offline once the page has loaded, and there is nothing to delete afterward because nothing was ever uploaded. You can prove it: open your browser DevTools, watch the Network tab while you convert, and you will see no traffic. This matters most for the content YAML typically carries, namely secrets and credentials like Kubernetes kubeconfig data, Helm value overrides, CI tokens, and database passwords, which should never be pasted into a third-party server.
No limits
No file-size cap, no document-count limit, no watermark, no sign-up, and no ads. Convert as many manifests or values files as you need.
Frequently asked questions
- Is converting YAML to JSON lossy? What gets dropped?
- Yes, it is lossy. Comments, anchor and alias references, merge keys, and the visual formatting of block scalars do not survive, because JSON has no syntax for any of them. The data values themselves are preserved, but the YAML-specific structure around them is flattened or removed.
- What happens to my YAML comments when I convert to JSON?
- Every
#comment is stripped during conversion and cannot be recovered. JSON has no comment syntax at all, so there is nowhere for those lines to go in the output. Keep a copy of the original YAML if the comments are important to you. - Are my YAML anchors and aliases preserved in the JSON output?
- No. Anchors (
&) and aliases (*) are resolved and expanded inline, so each referenced value is duplicated everywhere it was aliased. Merge keys (<<) are flattened the same way, since JSON has no concept of references or deduplication. - Can I convert a multi-document YAML file separated by ---?
- Yes. A multi-document YAML stream has no single JSON equivalent, so it is split and emitted as a JSON array with one element per document. The document-end markers (
...) are dropped in the process. - Is it safe to convert a YAML file with secrets or Kubernetes credentials here?
- Yes, because the conversion runs entirely in your browser via Rust and WebAssembly with zero network requests. Your kubeconfig data, API keys, and database credentials never touch a server or a log. You can confirm this in your browser's DevTools Network tab.
- Does my YAML get uploaded to a server, or is it converted in my browser?
- It is converted locally in your browser and never uploaded. The tool works offline after the page loads, which is only possible because all processing is client-side. Nothing is stored or transmitted.
- What is the difference between YAML and JSON, and why convert?
- YAML uses indentation and is optimized for humans to read and edit, while JSON uses braces and quotes and is what most APIs, validators, and JS tooling consume. You convert YAML to JSON when a machine needs the data; you keep YAML when a person needs to maintain it.
- Can I convert a Kubernetes or Helm YAML manifest to JSON?
- Yes, that is one of the most common uses. Paste the manifest or values file and you get JSON suitable for an API call or a JSON Schema validator. Because it runs locally, the secrets and overrides inside those files stay on your machine.
- Why did my unquoted values like no, yes, or 1.20 change type?
- YAML uses implicit typing, so unquoted
no,yes,on, andoffare parsed as booleans and values like1.20are read as numbers. JSON forces explicit types, so the output simply makes those real parsed types visible. Quote the values in your YAML if you intended them as strings. - Can I get minified or pretty-printed JSON output?
- Yes. Pretty output uses 2-space indentation for readability, while minified output strips whitespace to reduce byte size. The JSON of the same data is usually larger than the source YAML either way, because of the added braces, brackets, and quotes.
Related tools: convert in the other direction or to TOML with the YAML / JSON / TOML converter, tidy the result with the JSON formatter, or read why everything here runs in your browser in our privacy-first approach. See all text and data tools.