How to use the array to csv converter
- Paste your JSON array into the JSON array field. It can be an array of arrays like
[["a",1]]or an array of objects like[{"a":1}]. - Select a Delimiter from the dropdown. Comma is standard, but semicolon or tab may suit your target application better.
- If you are converting an array of objects, check or uncheck Include header row depending on whether you need column names.
- The converted CSV appears immediately in the output area below. Copy it to your clipboard or save it to a file.
Supported input formats
The array to csv converter accepts two JSON structures. The first is an array of arrays, where each inner array represents one row of data. The second is an array of objects, where each object represents a row and its keys define the columns.
For an array of arrays, every inner array must contain only primitive values such as strings, numbers, booleans or null. Nested arrays or objects inside a row are not valid CSV cells and will produce an error. For an array of objects, the tool collects all unique keys across every object to build the complete set of columns. If a particular object is missing a key that another object has, that cell is left empty in the output. A value that is itself an object or array is written as JSON text inside one cell. A flat array of plain values becomes one row per value.
How CSV escaping works
RFC 4180 defines strict rules for formatting CSV data. When converting your array to csv, the tool applies these rules automatically so you do not have to worry about broken imports.
A field must be enclosed in double quotes if it contains the chosen delimiter character, a double quote character or a line break. Any double quote inside a field is escaped by doubling it. For example, the string He said "hello" becomes "He said ""hello""" in the output. A field containing a comma like New York, NY becomes "New York, NY". Line breaks within a field are preserved inside the quotes, ensuring spreadsheet applications parse them as a single cell rather than splitting them into multiple rows.
Choosing the right delimiter
While comma is the default and most common delimiter, other characters are frequently used depending on region or software requirements. Semicolons are standard in many European locales where the comma serves as the decimal separator. Tab separated values are popular in bioinformatics and log processing because tabs rarely appear in natural text data.
| Delimiter | Common use case |
|---|---|
Comma (,) | Standard CSV, spreadsheets, databases |
Semicolon (;) | European Excel defaults, some legacy systems |
| Tab | TSV files, data science pipelines, log files |
Pipe (|) | Custom internal tools, avoiding conflicts with text data |
Selecting the correct delimiter ensures your target application reads the columns without shifting data into the wrong fields.
Handling missing keys in objects
When you provide an array of objects, not every object needs to share the exact same keys. The converter scans all objects from first to last and builds a master list of headers in the order they first appear. If the first object has keys name and age, and the third object introduces email, the resulting CSV will have three columns: name, age and email.
Objects that lack a discovered key simply output an empty field for that column. This behavior matches how Python's csv.DictWriter handles missing keys when no explicit fieldnames are provided, making the output predictable and safe for downstream processing.
Converting back and forth
Data transformation often requires moving between formats. After generating your CSV, you might need to feed it into other tools. If you need to reverse the process, the csv to array tool parses CSV text back into a JSON array structure.
For other output targets, you can take your generated CSV and convert it further. Use csv to xml for XML documents, csv to yaml for configuration files, or csv to html table for web pages. If you need tab separated output instead of comma separated, csv to tsv handles that specific conversion, while tsv to csv does the reverse.
Worked examples
| Example | Input | Result |
|---|---|---|
| Array of arrays | JSON array: [["Name","Age","City"],["Alice",30,"New York"],["Bob",25,"London"]]; Delimiter: ,; Include header row for objects: yes | Name,Age,City / Alice,30,New York / Bob,25,London |
| Array of objects | JSON array: [{"Name":"Alice","Age":30},{"Name":"Bob","Age":25}]; Delimiter: ,; Include header row for objects: yes | Name,Age / Alice,30 / Bob,25 |
| Semicolon delimited | JSON array: [["Product","Price"],["Widget","9.99"],["Gadget","19.99"]]; Delimiter: ;; Include header row for objects: yes | Product;Price / Widget;9.99 / Gadget;19.99 |
FAQ
What JSON formats does this array to csv tool accept?
It accepts a JSON array of arrays (where each inner array is a row) or a JSON array of objects (where each object is a row and its keys are columns). Primitive values like strings, numbers, booleans and nulls are supported inside the rows.
Does the converter handle commas and quotes inside my data?
Yes. Fields containing commas, double quotes or line breaks are automatically wrapped in double quotes. Any double quote inside a field is escaped by doubling it, following RFC 4180 standards.
Can I use a semicolon or tab instead of a comma?
Yes. You can select comma, semicolon, tab or pipe as the delimiter from the dropdown menu before or after pasting your data.
What happens if my objects have different keys?
The tool collects all unique keys from every object in the order they first appear to create the header row. If an object is missing a key found in another object, that cell is left empty in the CSV output.
Is my data sent to a server during conversion?
No. The array to csv conversion runs entirely in your browser using JavaScript. Your data never leaves your device and nothing is uploaded anywhere.
Why does the output use CRLF line endings?
RFC 4180 specifies that CSV records should be separated by a carriage return followed by a line feed (CRLF). This ensures maximum compatibility with spreadsheet programs and database importers.