Free CSV / JSON / XML / YAML Converter Online

Convert between CSV, JSON, XML, and YAML formats instantly. Bidirectional conversion with pretty print, minify, delimiter options, and nested data support. 100% client-side — your data stays private.

Data Converter

How do you convert between CSV, JSON, XML and YAML? You parse the source format into a generic in-memory structure of objects, arrays and scalars, then serialise that structure into the target format. This converter does both halves in the browser: CSV rows become objects keyed by the header line, XML is read with the browser's own DOMParser, and JSON, XML or YAML is written back out with two-space indentation or minified.

How to Use the Data Converter

  1. Paste your data — Drop CSV, JSON, XML or YAML into the input box. The format dropdown sniffs the first characters — a leading { or [ means JSON, < means XML, --- or a key: line means YAML — but you can override the guess.
  2. Pick the output format — The two dropdowns are independent, so every one of the twelve cross-format directions works, and JSON to JSON is a valid way to reformat a file.
  3. Set the CSV delimiter — Comma, semicolon, tab or pipe. Semicolon matters for spreadsheets exported in locales where the comma is the decimal separator; tab matches what Excel puts on the clipboard.
  4. Say whether the CSV has a header row — With the switch on, the first line supplies the object keys and each later line becomes one record. With it off, every line becomes a plain array of values with no keys at all.
  5. Choose pretty print or minified — Pretty print uses two-space indentation for readable diffs and code review. Minified strips all optional whitespace from JSON, which is what you want before embedding a payload in a request body.
  6. Convert, then copy or download — Press Convert to fill the output box. Download saves the result as converted.json, .csv, .xml or .yaml depending on the target format.

How the Conversion Pipeline Works

Nothing converts CSV directly into YAML. Every conversion here is two independent steps joined by a common representation: parse turns the input into ordinary JavaScript objects, arrays, strings, numbers and booleans, and serialise writes that structure out in the format you asked for. Because the middle is format-neutral, all four input formats pair with all four output formats without a dedicated converter for each pair.

The consequence worth understanding is that the intermediate structure is the ceiling on fidelity. Anything a format expresses that plain objects and arrays cannot hold — XML comments, YAML anchors, CSV column ordering across ragged rows — is gone by the time serialisation starts. Conversions between formats of similar expressive power (JSON and YAML) are close to lossless; conversions down to a flat tabular format (anything to CSV) are not.

What Each Format Parser Does

FormatHow it is readWhat to watch for
CSV Character-by-character line parser following the RFC 4180 quoting rules A field wrapped in double quotes may contain the delimiter, and a doubled "" inside it means one literal quote. Records are split on newlines, so a quoted field that itself spans several lines is not supported
JSON The engine's native JSON.parse Strict RFC 8259: double-quoted keys, no trailing commas, no comments. An error message means the input is genuinely invalid JSON, not a quirk of this tool
XML The browser's built-in DOMParser in text/xml mode Attributes are kept as keys prefixed with an at sign, and repeated sibling elements with the same tag name collapse into an array. Text-only elements become plain strings
YAML A compact indentation-based parser for the common subset Block mappings, - sequences, comments and automatic typing of true, false, null and numbers are handled. Anchors, aliases, flow style, multi-document streams and block scalars are not

How the Output Side Behaves

Writing CSV starts by collecting the union of keys across every record, so a row missing a field still lines up under the right column instead of shifting. Values are quoted only when they need to be — when they contain the delimiter, a double quote or a newline — and any nested object or array is serialised to compact JSON inside its single cell rather than being silently dropped. Writing XML emits a <?xml version="1.0" encoding="UTF-8"?> declaration, wraps everything in a <root> element, indents two spaces per level, and escapes the five characters that would otherwise break the document. Writing YAML quotes any scalar that could be misread as a number, a boolean or a structural character.

The conversion runs entirely in the page — no upload, no server round trip. One thing to know: pressing Convert also writes your settings and input into the address bar with history.replaceState so a conversion can be bookmarked or shared. That URL contains your data, so use Clear before copying the link if the content is sensitive.

Frequently Asked Questions

It reads one serialisation format into a neutral structure of objects, arrays and scalar values, then writes that structure out in another format. The data model is the same in both halves — only the notation changes. That is why CSV, JSON, XML and YAML can all be paired freely here, and why a conversion can never add information the source did not contain.

Yes for JSON, XML and YAML, which can all represent nesting directly. CSV cannot: it is a flat grid. When a nested value has to land in a CSV cell it is written as compact JSON text inside that cell, so nothing is lost, but the result is a string rather than real structure. Convert CSV to JSON first if you need to reshape nested data.

Comma, semicolon, tab and pipe on both the reading and writing side. Quoting follows RFC 4180: a field may be wrapped in double quotes, and a doubled quote inside it means one literal quote character. On output, a value is quoted only if it contains the delimiter, a double quote or a newline, which keeps files diffable.

No. Parsing and serialising both happen in JavaScript in your tab, and the download is created from an in-memory blob. Note that pressing Convert also copies your input and settings into the page URL so the conversion can be bookmarked or shared — clear the input before sharing that link if the data is confidential.

YAML for files a human edits — CI pipelines, Kubernetes manifests, application config — because it allows comments and drops most punctuation. JSON for machine interchange, because every language parses it identically and there is no indentation ambiguity. The two carry the same data model, so converting between them is close to lossless in both directions.

The YAML reader covers the everyday subset: block mappings, indented - sequences, comments, and automatic typing of numbers, true, false and null. It does not implement anchors and aliases (&name / *name), flow style ({a: 1} on one line), multi-document streams separated by ---, or block scalars (| and >). Files using those need a full YAML library.

Almost always a delimiter or quoting mismatch. Check that the delimiter dropdown matches the file — European exports frequently use semicolons — and that the header switch matches reality; leaving it on for a headerless file turns your first data row into column names. The other common cause is a quoted field containing a line break, which this parser splits as if it were a new record.

Everything is held in memory as a string plus the parsed structure, so the practical limit is your device's available memory and patience rather than a fixed cap. Files up to a few megabytes convert instantly; tens of megabytes will make the tab pause while parsing. For a multi-hundred-megabyte export, use a streaming tool on the command line.

Use Cases

CSV to JSON for APIs

Convert CSV spreadsheet data to JSON format for use with REST APIs, web services, and JavaScript applications that require structured data.

XML to YAML Config Files

Transform XML configuration files to YAML format for modern DevOps tools, Kubernetes manifests, and CI/CD pipeline configurations.

Format Migration

Migrate data between formats when switching tools, APIs, or platforms that require different data interchange formats like JSON, XML, or YAML.

Dataset Preparation

Prepare datasets for analysis by converting between formats, with support for nested structures, custom delimiters, and pretty print options.

Data Interchange Standardization

Standardize data interchange formats across systems and teams by converting between CSV, JSON, XML, and YAML with consistent output.