Home Text Data Developer Files Media Utilities

Data Converter Privacy: local processing only

Convert between JSON, CSV, XML, and YAML. Handles nested data, flattening, XML attributes, type inference, and format-specific options.

πŸ“‚ Drop a file here or click to select (.json, .csv, .tsv, .xml, .yaml, .yml, .ndjson, .txt)
Samples:
Source0
Result0
Conversion Optionsβ–Ό
CSV / TSV Options
JSON Options
XML Options
YAML Options
CSV Input Options

How It Works

What the Data Converter Does

This tool converts structured data between JSON, CSV, XML, and YAML β€” all within your browser. Paste data, pick source and target formats, and get a properly converted result with explicit handling of nested objects, arrays, attributes, and types.

Why JSON, CSV, XML, and YAML Don't Map Perfectly

JSON supports nested objects and arrays at any depth. CSV is flat: each row has the same columns. XML has elements, attributes, text nodes, and namespaces. YAML adds comments, anchors, and aliases. Converting between these formats requires trade-offs β€” and this tool makes those trade-offs visible.

Nested JSON and CSV Flattening

When converting JSON to CSV, nested objects are flattened using dot notation by default: subscription.plan, subscription.cost. Arrays are JSON-stringified into cells unless you choose "expand to columns" or "join with separator". This prevents the notorious [object Object] problem.

XML Attributes, Text Nodes, and Repeated Elements

When converting XML to JSON, attributes use the @ prefix (e.g., @id), text content uses #text when mixed with attributes, and repeated child elements become arrays. When converting JSON to XML, keys starting with @ become attributes, and arrays become repeated elements.

YAML Anchors, Aliases, and Comments

YAML comments cannot be preserved in JSON β€” they have no JSON equivalent. YAML anchors and aliases are expanded during parsing. A warning is shown when comments or anchors are detected, so you know what won't round-trip.

Type Inference and Safe Conversion

In "Safe" mode, obvious numbers, booleans, and null values are converted. Values with leading zeros (like ZIP codes 08001) and large integers beyond safe limits are preserved as strings. Set type inference to "Off" to keep all values as strings.

Lossy Conversion Warnings

When a conversion cannot preserve all information perfectly, a lossiness report appears. For example: "Nested objects were flattened using dot notation" or "YAML comments are not preserved in JSON". No data is silently dropped.

Privacy and Local Processing

All conversion happens locally in JavaScript. Your data never leaves your browser. There are no server requests during conversion, no analytics on content, no storage of your data. Verify in DevTools β†’ Network tab.

FAQ

Is my data uploaded?
No. All conversion happens locally in your browser. No data is sent to any server.
Why did nested JSON become multiple CSV columns?
CSV is flat. Nested objects are flattened using dot notation (e.g., user.name) to preserve data without losing structure. You can switch to "JSON-stringify" in options to keep nested values as JSON strings in cells instead.
Why did an array become a JSON string inside a CSV cell?
Arrays don't have a native CSV representation. By default, they're JSON-stringified. You can choose "join with separator" or "expand to columns" in CSV options.
Can I convert CSV back to nested JSON?
Yes. Enable "Unflatten dotted headers" in CSV Input Options. Headers like user.name will create nested objects.
How are XML attributes represented in JSON?
Attributes use the @ prefix: <user id="1"> becomes {"@id": 1}. Text content uses #text when mixed with attributes or child elements.
Are YAML comments preserved?
No. YAML comments have no equivalent in JSON, CSV, or XML. A warning is shown when comments are detected in the source.
Can I convert large files?
Yes, within browser memory limits. A warning appears for files over 1 MB. Very large files may cause brief UI pauses during conversion.
What is NDJSON?
NDJSON (Newline Delimited JSON) is one JSON object per line β€” no wrapping array. It's used for logs, streaming APIs, and database imports.
Why is CSV conversion sometimes lossy?
CSV is inherently flat. Nested objects, arrays, mixed types, and metadata require trade-offs: flattening, stringification, or omission. The tool shows exactly what changed.
Should I use a focused converter instead?
For fine-grained control over a specific pair, use our dedicated tools like CSV to JSON, JSON to CSV, or JSON to XML. This page is for quick multi-format work.