---
title: Convert JSON, YAML, CSV, and XML | Prettify Docs
description: Convert JSON, JSONL, YAML, CSV, and XML on your device. See what
  each format drops, and batch convert many files with Pro.
url: https://prettify.tools/docs/conversion
---

[Docs](https://prettify.tools/docs) / Editing tools

# Format conversion

Last updated: October 29, 2026

Prettify converts the open document between JSON, JSONL, YAML, CSV, and XML. Conversion runs on your device; nothing is uploaded. Format conversion is free in [Prettify](https://prettify.tools/app/editor).

## Convert the open document

Load a document in one of the data formats, then convert it.

1. Open the editor and load your data.
2. Click Convert in the editor toolbar, under the Transform group.
3. Pick the target format from the menu.

You can also open the Command Palette with `Cmd+K` (Mac) / `Ctrl+K` (Windows, Linux) and choose a convert command.

The converted text opens in the current tab as a separate document, named after the original with the target format, such as `orders (CSV)`. The original document stays in [History](https://prettify.tools/docs/history), unchanged. If a document with that name and format already exists, the conversion is saved as a new version of it. The source and target must both be data formats. Mermaid, Markdown, MDX, HTML, and SVG are text documents, so they have no convert menu.

## What each target can carry

Every format holds a different shape of data, so some detail cannot move across. Prettify shows a warning when a conversion drops or changes something. The table lists the common cases.

| Conversion          | What changes                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Any format to CSV   | CSV holds a table of rows. A non-array document is wrapped in an array. A nested object becomes dotted columns, such as `address.city`. An array stays in one cell as JSON text. Converting the CSV back keeps `address.city` as one key. A text value that starts with `=`, `+`, `-`, or `@` gets a leading `'`, so a spreadsheet shows it as text and does not run it as a formula. Plain numbers such as `-5` do not change. |
| Any format to XML   | Keys that are not valid XML names are renamed. A single-item array becomes one element and reloads as a single value, not an array.                                                                                                                                                                                                                                                                                             |
| XML to JSON         | XML attributes become `@attribute` keys.                                                                                                                                                                                                                                                                                                                                                                                        |
| YAML to JSON        | YAML comments are removed.                                                                                                                                                                                                                                                                                                                                                                                                      |
| Any format to JSONL | A non-array document becomes a single-element array when it is reloaded as JSONL.                                                                                                                                                                                                                                                                                                                                               |
| CSV with a preamble | Metadata lines above the CSV header are not included in the output.                                                                                                                                                                                                                                                                                                                                                             |

Large or high-precision numbers are preserved exactly in JSON and JSONL. Converting such numbers to YAML, CSV, or XML may lose precision, and Prettify warns when it does.

## Batch convert many files (Pro)

Batch Processing (Pro) converts whole folders of files at once.

1. Open Batch process from the dashboard, or the Command Palette.
2. Add files, or a folder.
3. Choose the Convert operation and a target format.
4. Run the batch, then download the results as a zip, or save them to a folder.

Batch Processing accepts up to 200 files and 50 MB total per run. A file that cannot be converted is skipped or reported, so one bad file does not stop the batch. Batch Processing is part of [Prettify Pro](https://prettify.tools/docs/pro).

## Related

- [Convert JSON, YAML, CSV, and XML tool pages](https://prettify.tools/json-to-yaml), and [YAML to JSON](https://prettify.tools/yaml-to-json), [CSV to JSON](https://prettify.tools/csv-to-json), [JSON to CSV](https://prettify.tools/json-to-csv)
- [JSON](https://prettify.tools/docs/json), [YAML](https://prettify.tools/docs/yaml), [CSV and TSV](https://prettify.tools/docs/csv), [XML](https://prettify.tools/docs/xml)
- [Transforms: Sort Keys and Reshape Data](https://prettify.tools/docs/transforms)

## Try it online

Tool pages for this topic. Each one runs in your browser.

- [JSON to YAML](https://prettify.tools/json-to-yaml)
- [YAML to JSON](https://prettify.tools/yaml-to-json)
- [JSON to CSV](https://prettify.tools/json-to-csv)
- [CSV to JSON](https://prettify.tools/csv-to-json)
- [XML to JSON](https://prettify.tools/xml-to-json)
- [JSON to XML](https://prettify.tools/json-to-xml)
- [CSV to YAML](https://prettify.tools/csv-to-yaml)
- [YAML to CSV](https://prettify.tools/yaml-to-csv)

* [PreviousSearch and replace](https://prettify.tools/docs/search-and-replace)
* [Next Transforms](https://prettify.tools/docs/transforms)

## Structured data

```json
{
  "@context": "https://schema.org",
  "@type": "SoftwareApplication",
  "name": "Prettify",
  "url": "https://prettify.tools",
  "description": "Multi-format data viewer, editor, and query engine for JSON, YAML, CSV, XML, Mermaid, Markdown, MDX, HTML, and SVG",
  "applicationCategory": "DeveloperApplication",
  "operatingSystem": "Web, macOS, Windows, Linux",
  "offers": [
    {
      "@type": "Offer",
      "price": "0",
      "priceCurrency": "USD",
      "description": "Free tier with core features"
    },
    {
      "@type": "Offer",
      "price": "19.99",
      "priceCurrency": "USD",
      "description": "Pro: lifetime access to all features"
    }
  ],
  "publisher": {
    "@id": "https://prettify.tools/#organization"
  }
}
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "@id": "https://prettify.tools/#organization",
  "name": "Prettify",
  "legalName": "Off Leash Labs",
  "url": "https://prettify.tools/",
  "logo": {
    "@type": "ImageObject",
    "url": "https://prettify.tools/icon-512.png",
    "width": 512,
    "height": 512
  },
  "contactPoint": {
    "@type": "ContactPoint",
    "contactType": "customer support",
    "email": "offleashlabs@gmail.com",
    "availableLanguage": "English"
  }
}
```
