Convert CSV to an Array of Arrays
Convert a CSV file to an array of arrays of fields. Runs entirely in your browser, so your data never leaves your device.
Runs on your device, nothing uploaded
0 chars · 0 lines
Output
Convert a CSV file to an array of arrays of fields.
Type or paste above to see the result here.
What you paste never leaves this tab
Convert CSV to an Array of Arrays is JavaScript that your browser has already downloaded, and it does the whole job on your own machine. On a normal site, a customer export full of names and emails is sent to a server that can log it, cache it or keep it. Here it is read and transformed inside this tab and nowhere else.
- No upload
- No length limit
- Works offline once loaded
- Nothing stored or logged
How to use Convert CSV to an Array of Arrays
- 1. Paste the CSV. Add the data to the input pane. Every record becomes one inner array of field values, and the whole file becomes the outer array wrapping them.
- 2. Type the values sensibly. Tick Numbers as numbers so 36 becomes the number 36 and true becomes a boolean, instead of everything arriving as strings. Leave it off to preserve values verbatim.
- 3. Control the formatting. Format One line produces a single compact line for embedding, while Pretty 2, Pretty 4 or Tabs put each record on its own indented line.
- 4. Copy the JSON. Copy the array of arrays into your source code, API mock or test file. It parses with JSON.parse and feeds directly into table components.
When to use Convert CSV to an Array of Arrays
Convert CSV to an Array of Arrays produces the 2D-array JSON representation of a table, headers and rows alike as positional lists. This shape is what charting libraries, grid components and matrix code most often want, in contrast to the array-of-objects style keyed by column names.
- Feeding a charting library. Google Charts and similar APIs take data as rows of arrays with a header row first. Converting your CSV gives you the exact structure their constructors expect.
- Embedding fixture rows in tests. A parameterized test iterates over cases defined as arrays of values. Convert the spreadsheet of cases once and paste the minified result into the test file.
- Seeding a spreadsheet component. Grid widgets like Handsontable initialize from a 2D array. Your product data exported as CSV converts straight into their data prop with types intact.
- Doing matrix math in JavaScript. Numeric CSV data destined for array-based computation needs real numbers, not strings. The type conversion option delivers a ready-to-use nested numeric array.
Examples
One inner array per record
Input
name,age Ada,36
Output
[ ["name", "age"], ["Ada", 36] ]
About the Convert CSV to an Array of Arrays tool
Convert CSV to an Array of Arrays is a free online tool that works entirely inside your web browser. Convert a CSV file to an array of arrays of fields. Because the processing happens on your own device, nothing you enter is uploaded, logged or stored anywhere.
This page is one of 133 CSV utilities on EditSafely. Each one does a single job well, and all of them follow the same rule: your input stays on your machine.
You can shape the output with 2 settings, including Numbers as numbers and Format, and the result refreshes the moment you change one. A worked example further down the page shows exactly what the tool produces for a real input.
Because nothing leaves your device, the tool is suitable for sensitive content such as internal documents, credentials or customer data. It also responds instantly, since every step is handled on your own machine rather than by a remote API.
Frequently asked questions
Does Convert CSV to an Array of Arrays cost anything?
Yes, it is completely free. All 2,943 tools on EditSafely work without an account, a subscription or usage limits.
Is it safe to paste sensitive or confidential data?
No data leaves your device. The whole tool is JavaScript that runs inside your browser tab, so there is no upload, no server-side processing and no log of what you did. If you disconnect from the internet after the page loads, it keeps working.
How much text can I process at once?
There is no fixed limit; your device's memory is the ceiling. Up to 10 MB the result updates as you type, after a short pause that grows with the size. Above 10 MB a Run button appears so typing stays smooth, and files open up to 50 MB. A very long result shows its first 2,000 lines on screen, while Copy and Download always include all of it.
Do I need to sign up or install anything?
Nothing to install and no account needed. Open the page in any up-to-date browser, including on a phone or tablet, and the tool is ready.
How do I use the result?
The output panel has a one-click copy button, and you can keep refining the input while you work; the result updates in place as you type.