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.
0 chars · 0 lines
Output
The result appears here as you type.
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 Convert numbers and booleans 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. Minify output produces a single compact line for embedding, while the Indent setting (2 spaces, 4 spaces or Tabs) governs the pretty-printed layout when minification is off.
- 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 3 settings, including Convert numbers and booleans, Minify output and Indent, 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 keystroke 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,658 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. Because the work happens on your own device rather than on a shared server, the practical ceiling is your machine's memory, which comfortably handles inputs far larger than typical online tools allow.
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.