# JSON YAML CSV XML Converter

> Convert JSON, YAML, CSV and XML in any direction. The format is detected and errors show the line. No upload.

- Open in browser: https://pockettoolbox.org/en/data-converter
- Runs entirely in your browser; files and input are never uploaded.

## How it works

Converts structured data between JSON, YAML, CSV and XML.

Paste data or drop a file. The input format is detected automatically and can also be set manually. The result appears as you type in the target format and can be copied or saved as a file. On syntax errors the tool names the line. The swap button turns the result into the new input, for example to check a round trip.

Parsing and output with the libraries yaml (YAML 1.2), Papa Parse (CSV with automatic detection of comma, semicolon and tab) and fast-xml-parser (attributes as keys with an @ prefix). For CSV, nested objects are flattened into columns with dot notation (address.city), lists are stored as JSON text. Numbers and true/false from CSV are kept as values, values with leading zeros such as postal codes stay text.

## FAQ

### How is nested JSON shown in CSV?

Nested objects become columns with dot notation, {"address": {"city": "Cologne"}} becomes the column address.city. Lists inside an entry are stored as JSON text in one cell. Converting back from CSV rebuilds the nested objects.

### What happens to XML attributes?

Attributes become keys with an @ prefix, <price currency="EUR">9.90</price> becomes {"price": {"@currency": "EUR", "#text": 9.9}}. Converting back to XML turns them into attributes again.

### Can I paste confidential data?

Yes. The conversion runs entirely in your browser, nothing is uploaded or stored.

---
PocketToolbox (https://pockettoolbox.org/en)
