JSON, CSV, XML, YAML, TOML Data Format Converter
by chunyunglo
README.md
# JSON, CSV, XML, YAML, TOML Data Format Converter
Convert text between **JSON, JSON Lines, CSV, XML, YAML and TOML** in a single call. Paste your data, choose the source and target format, and get the converted text back. No code, no setup. The Actor also runs as an MCP server, so AI agents can call it as a tool.
## What it does
- Reads JSON, JSON Lines, CSV, XML, YAML or TOML.
- Writes any of those formats.
- Nested JSON/YAML/XML is flattened for CSV output using dotted column names (for example `address.city`). Arrays inside a row become a compact JSON string in that cell.
- XML attributes appear as keys starting with `@`, and element text next to attributes appears as `#text`.
- CSV output unwraps a single-key wrapper (for example an XML `<root><item>...</item></root>`) so repeated items become rows.
- Optional type inference when reading CSV (numbers and true/false).
- Clear error messages when the input cannot be parsed.
Everything runs offline on the text you provide. Nothing is fetched from the web.
## Input example
```json
{
"data": "[{\"name\":\"Ann\",\"age\":30},{\"name\":\"Bob\",\"age\":25}]",
"fromFormat": "json",
"toFormat": "csv"
}
```
Fields: `data`, `fromFormat`, `toFormat` (required); `indent` (0-8, JSON output, 0 = compact); `csvDelimiter` (comma, semicolon, tab, pipe); `inferTypes` (CSV input); `xmlRootName` (wrapper element for XML output).
## Output example
```json
{
"output": "name,age\nAnn,30\nBob,25",
"fromFormat": "json",
"toFormat": "csv",
"records": 2,
"characters": 22
}
```
## Pricing
US$0.002 per conversion (one run = one conversion).
## Limits
- Input up to 2,000,000 characters.
- CSV is flat by nature, so converting nested data to CSV is lossy for arrays (they become JSON strings) and CSV cannot be converted back to the original nesting.
- TOML output requires an object (or a list, which is wrapped under `items`) and cannot represent null values.
- XML needs a single root element; if your data has none, it is wrapped in the element named by `xmlRootName`.
- XML entity declarations are rejected for safety.
- Binary documents (PDF, images, OCR) and web page extraction are not supported.
## Credits
Built on open-source libraries:
- [xmltodict](https://github.com/martinblech/xmltodict) (MIT)
- [PyYAML](https://github.com/yaml/pyyaml) (MIT)
- [tomli](https://github.com/hukkin/tomli) and [tomli-w](https://github.com/hukkin/tomli-w) (MIT)
---
**Hosted version:** [Apify Store](https://apify.com/chun_yung_lo/json-csv-xml-yaml-toml-converter) · **Docs:** [https://chunyunglo.github.io/afw-tools/json-csv-xml-yaml-toml-converter/](https://chunyunglo.github.io/afw-tools/json-csv-xml-yaml-toml-converter/)
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues