File Format Converter
About the File Format Converter
This file format converter handles two jobs in one place: batch-converting images to PNG, JPG or WebP, and converting data between JSON, CSV, TSV, XML and YAML. Data output updates as you type, and every file is processed in your browser.
JSON vs CSV vs XML vs YAML
JSON is the default for APIs and JavaScript: nested objects, arrays, numbers and booleans. CSV and TSV are flat tables that open directly in Excel, Google Sheets and database import tools. XML is verbose but still common in feeds, SOAP services, office formats and enterprise systems. YAML is a human-friendly superset of JSON used for configuration such as Kubernetes manifests, GitHub Actions and Docker Compose.
A practical rule: JSON to move data between programs, CSV to hand data to a spreadsheet, YAML for config files people edit by hand.
How JSON to CSV conversion works
CSV needs a list of records. The converter expects an array of objects (or a single object), uses the union of all keys as the header row, and leaves a cell empty when a record lacks that key.
Nested values cannot be represented in a flat table, so they are written as JSON text inside the cell. For example {"tags":["a","b"]} becomes a tags column containing ["a","b"]. Fields containing commas, quotes or line breaks are quoted following RFC 4180.
Going the other way, CSV values like 42, true, false and null become real JSON numbers, booleans and null. Values such as 007 keep their leading zeros because they are left as strings.
How XML maps to JSON
The root element becomes the top-level key. Attributes are stored with an @ prefix and mixed text content under #text, so <user id="7">Ada</user> becomes {"user": {"@id": 7, "#text": "Ada"}}. Repeated child elements turn into an array.
When converting JSON to XML, a top-level array is wrapped in a <root> element with one <item> per entry, and keys that are not valid XML names have invalid characters replaced with _.
Image conversion and its limits
The Images tab accepts anything your browser can decode (PNG, JPEG, WebP, GIF, BMP, SVG, ICO, AVIF) and outputs PNG, JPEG or WebP at the original dimensions. Animated GIFs become their first frame, and JPEG output fills transparency with white.
Document formats such as PDF, DOCX or XLSX are not supported. This tool focuses on images and plain-text data formats that can be converted reliably without a server.
How to Use the File Format Converter
- Pick a tab: Images for picture files, or Data (JSON / CSV / XML) for structured text.
- Images: choose one or more files, select PNG, JPEG or WebP under Convert to, set Quality for lossy formats, and click Convert. Download each result from the list.
- Data: choose the From and To formats, then paste your data into the Input box or use Or open a file. Opening a .csv, .json, .xml or .tsv file sets the source format automatically.
- Read the converted result in the Output panel. Errors such as invalid JSON or an unterminated CSV quote appear in its place.
- Click Copy or Download to save the output. Use the swap button to reverse the conversion and check the round trip.
Frequently Asked Questions
- Are my files uploaded to a server?
- No. Images are converted with the canvas API and data is parsed with JavaScript in your browser tab. Nothing is sent over the network.
- Can I convert YAML to JSON?
- Not yet. YAML is available as an output format only. JSON, CSV, TSV and XML can be used as input.
- Why do I get "CSV/TSV output needs an object or an array of objects"?
- CSV is a table, so the JSON must be a list of records like [{"a":1},{"a":2}]. A bare array of numbers or strings has no column names to use.
- Does it convert PDF or Word documents?
- No. The converter covers images and text data formats. PDF, DOCX and XLSX need specialized libraries or a server.
- How does it handle nested JSON in CSV?
- Nested objects and arrays are written as JSON strings in a single cell, so no data is lost but the structure is not flattened into separate columns.
- Is there a file size limit?
- There is no fixed limit, but very large files are limited by your device's memory. Data files of several megabytes convert quickly in a modern browser.