YAML ⇄ JSON Converter
Convert YAML to JSON, JSON to YAML, or YAML to XML or CSV — open a file or load a URL, choose the indent. 100% in your browser, no upload.
Ln 1, Col 1
Multiple YAML documents separated by --- are combined into a JSON array.
{
"name": "MakerBox",
"tags": [
"free",
"private"
],
"nested": {
"count": 3
}
}🔒 Converted in your browser — nothing is uploaded.
Four targets, one page
Pick a direction: YAML → JSON, JSON → YAML, YAML → XML or YAML → CSV. The Swap button feeds the current output back in as the new input, so you can round-trip a document and compare the two formats — it works on the YAML/JSON pair and is disabled on XML and CSV, which are one-way here. Parsing is done by the well-tested js-yaml engine, so anchors, nested mappings, sequences and multiline scalars are handled correctly rather than by a fragile hand-written parser. A stream of several documents separated by --- (a Kubernetes manifest, a CI config) becomes a JSON array, or one <item> element per document in XML. You can link straight at a direction with ?dir=json-to-yaml, ?dir=yaml-to-xml or ?dir=yaml-to-csv.
Getting the file in, and the file out
Type it, paste it, open a .yaml, .yml, .json or .txt file from your disk (up to 10 MB), or type a web address and have your own browser fetch it — that needs a host which allows cross-origin reads, such as raw.githubusercontent.com; a host that does not is named as exactly that rather than as a bad address. The download is named after whatever you opened, so settings.yaml leaves as settings.json. JSON can be minified or indented with 2 spaces, 4 spaces or a tab; YAML offers 2 or 4 spaces only, because YAML forbids a tab in indentation and cannot be minified, so those two are absent from the list rather than accepted and quietly ignored. Line endings (LF or CRLF) and a UTF-8 byte-order mark are yours to choose before you download.
When something is wrong, it says what and where
A syntax error is reported in the language of the page, with the line and column the parser stopped at when it says where — not as the library's English sentence. The caret's own line and column sit under the input box, so you can go straight to the line an error named. An integer beyond ±(2^53−1), such as a Snowflake ID, raises a warning, because JavaScript reads it as a double and silently rounds it; quote it and it stays an exact string. A recursive anchor (a: &x { b: *x }) is valid YAML that no JSON, XML or CSV text can describe, and it gets a sentence saying so instead of being called invalid YAML. CSV needs a list of records: a scalar, a list of plain strings or an empty list is refused rather than written out with array indices for column headings.
Why convert between YAML and JSON
YAML and JSON describe the same kinds of data — objects, arrays, strings, numbers and booleans — but YAML is easier for humans to read and write (config files, CI pipelines, Kubernetes manifests) while JSON is what most APIs and programs expect. Converting lets you author in whichever format is comfortable and hand off in whichever the tool on the other side needs. The conversion itself runs locally in your browser, so even secrets in a config file never leave your device; the only request the converter makes is your own browser fetching an address you typed. Remember what I typed on this device is off by default — tick it and the input is kept in this browser's own storage and nowhere else, and unticking erases it at once.
Frequently asked questions
Does the conversion work both ways?
Yes, and there are four directions in all: YAML → JSON, JSON → YAML, YAML → XML and YAML → CSV. The Swap button turns the output back into the input for the YAML/JSON pair; it is disabled on XML and CSV, which are one-way here.
What happens if my YAML or JSON is invalid?
No result is shown, and you get a sentence in the language of the page saying what is wrong — with the line and column the parser stopped at, where it reported one — so you can go to that spot instead of reading a library's English message.
Is my data uploaded anywhere?
No. Parsing and conversion run entirely in your browser, so nothing you paste or open is sent to a server, and it is safe for config files that contain secrets. The one network request is deliberate and yours: "Load from a web address" is your own browser fetching an address you typed. "Remember what I typed on this device" is off by default and, when ticked, keeps the input in this browser's storage only.
Can it convert YAML to XML or CSV?
Yes — choose YAML → XML or YAML → CSV in the Direction list. XML comes with the <?xml version="1.0" encoding="UTF-8"?> prolog and a <root> element, and a multi-document stream gets one <item> per document. CSV writes one row per record, flattens a nested key into a parent.child column, and keeps a list inside a row as one JSON cell. CSV needs a list of records: a scalar or a list of plain strings is refused rather than guessed at.
Can I get minified JSON, or indent with tabs?
Yes. For YAML → JSON the Indent list offers minified (no spaces), 2 spaces, 4 spaces and a tab. JSON → YAML offers 2 or 4 spaces only — YAML forbids a tab in indentation and cannot be minified, so those two are absent from the list rather than accepted and ignored.
Can I open a file or load one from a URL?
Both. Open file takes .yaml, .yml, .json and .txt up to 10 MB. "Load from a web address" fetches an http:// or https:// address in your own browser, which needs the host to allow cross-origin reads (raw.githubusercontent.com does). Either way the download is named after the file, so settings.yaml comes back as settings.json.
What happens to a multi-document YAML file?
Documents separated by --- are read in source order. YAML → JSON combines them into a JSON array, and YAML → XML gives each one its own <item> element. A single document converts to the bare value, not a one-element array.
Can I choose Windows line endings or add a BOM?
Yes. Line endings can be LF or CRLF, and the encoding can be UTF-8 or UTF-8 with a byte-order mark — which is what Excel wants when opening a CSV. LF with plain UTF-8 hands back exactly what the converter produced, with nothing rewritten.