Skip to content

Data format converter

Convert between JSON, YAML, CSV and XML in your browser, with a Swap button to reverse the direction.

or drop one here

Conversion result

Status

Ready

Click Convert to see the result below.

Input size
-
Output size
-

How it works

A data format converter parses text in one structured format and re-serializes the same data in another, so you can move a config file, an API response or a spreadsheet export between JSON, YAML, CSV and XML without hand-editing it.

  1. Pick the two formats

    Choose what you are converting from and to, or click Swap to reverse them.

  2. Load your data

    Paste it, drop a file, or choose one with the file picker.

  3. Convert, then copy or download

    The output appears below, ready to copy or save as a new file.

What survives the conversion

JSON and YAML both represent the same tree of objects, arrays, strings, numbers, booleans and null, so converting between them is lossless: a string that looks like a number, such as a zip code of 06000, is quoted in the YAML output so it round-trips back to the exact same string, not a number with the leading zero dropped. CSV is a flat table of rows and columns, so converting an object with nested objects or arrays to CSV flattens nested objects into dot-notation column names, such as address.city, and writes an array's contents as JSON text inside a single cell; converting that CSV back to JSON does not automatically reconstruct the original nested shape.

Converting to and from XML

XML supports attributes, namespaces, mixed content, and repeated sibling elements with the same tag name, none of which JSON or YAML have a direct equivalent for. This converter applies a common, opinionated mapping: repeated XML elements become a JSON array, and element text becomes a plain string or number. Always check the output for a complex XML document rather than assuming a perfect round trip.

Everything stays on your device

Parsing and conversion run entirely in your browser, including a file you drop or choose. Nothing you convert is sent to a server, so it is safe to use with production config files, internal data exports or data containing personal information.

Frequently asked questions

How do I convert JSON to YAML online?

Select JSON as the From format and YAML as the To format, paste your JSON into the input field, then click Convert. The tool parses the JSON and emits equivalent YAML with proper indentation. Click Swap to reverse the direction and convert YAML back to JSON.

Is my data safe when converting between formats in this tool?

Yes. The converter runs entirely in your browser using JavaScript, including a file you drop or choose. Your data is never uploaded to or processed by any external server, which makes it safe to convert production config files, internal data exports, or data containing personally identifiable information.

Does converting a numeric-looking string like a zip code lose its leading zero?

No. A string value that looks like a number, such as a zip code of 06000, is written as a quoted string in YAML output so it round-trips back to the exact same string. Only values that were already JSON or YAML numbers are written as numbers.

How do I convert a JSON array to CSV format?

Select JSON as the input format and CSV as the output format. The JSON should be an array of objects where each object represents one row; the keys become the CSV header row. Nested objects are flattened to dot-notation column names, and arrays are written as JSON text inside a cell, which the tool notes above the To format menu whenever CSV is selected as the output.

What are the limitations when converting between XML and JSON?

XML supports attributes, namespaces, mixed content, and repeated sibling elements with the same tag name, which JSON does not. The converter applies a common but opinionated mapping, for example turning repeated XML elements into a JSON array. Always verify the output for a complex XML document rather than assuming an exact round trip.