Convert CSV Rows to an Array
Create an array from one or more CSV rows. Runs entirely in your browser, so your data never leaves your device.
Runs on your device, nothing uploaded
0 chars · 0 lines
Output
Create an array from one or more CSV rows.
Type or paste above to see the result here.
What you paste never leaves this tab
Convert CSV Rows to an Array 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 Rows to an Array
- 1. Paste your CSV. Drop the comma-separated rows into the input pane. The chosen rows are collected into a JSON array with each field kept in its original order.
- 2. Choose which rows to extract. Tap row numbers in the input table, or type them in Rows as a list like 1, 3-5, or leave it empty for every record. Shape gives one inner array per row, or one flat array.
- 3. Decide how values are typed. Turn on Numbers as numbers to store digit-only fields as real JSON numbers and true/false text as booleans, instead of leaving every value as a quoted string.
- 4. Copy the JSON array. Copy the resulting array of values and paste it into a script, a test fixture, or anywhere a specific row's data needs to be represented as JSON rather than CSV.
When to use Convert CSV Rows to an Array
Convert CSV Rows to an Array pulls a specific row's fields out of a CSV and formats them as a JSON array, ready to paste straight into code. It targets one record at a time rather than the whole table.
- Building a single test case from sample data. A test suite needs one row of a CSV represented as a JSON array of arguments. Extracting that row directly saves manually retyping each field with correct quoting and types.
- Passing a record into a function call. You're debugging a function that expects an array of positional values, and the sample data lives in a spreadsheet row. Extracting it saves manual transcription errors.
- Documenting an example record in code comments. A code comment illustrates the expected shape of a data row using a JSON array. Extracting a real row from your CSV keeps the example accurate and up to date.
Examples
Each record as an inner array
Input
name,age Ada,36 Grace,45
Output
[ ["Ada", 36], ["Grace", 45] ]
The first record as one flat array
Input
name,age Ada,36
Output
["Ada", 36]
About the Convert CSV Rows to an Array tool
Convert CSV Rows to an Array does its work locally, right in the browser. Create an array from one or more CSV rows. There is no upload step, no queue and no account, and your data never travels over the network.
It belongs to the CSV Tools collection on EditSafely, a set of 133 small, focused CSV utilities that share the same instant, private workspace.
You can shape the output with 4 settings, including Rows (empty = all), Shape, First row is header (skipped) and Numbers as numbers, and the result refreshes the moment you change one. 2 worked examples further down the page show exactly what the tool produces for real inputs.
Running locally also makes the tool fast and dependable: results appear as soon as your input does, there is no server outage that can take it down mid-task, and confidential data can be processed without a second thought.
Frequently asked questions
Is Convert CSV Rows to an Array free to use?
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?
Everything happens locally. Your browser downloads the tool's code once, then does all the processing itself; nothing you enter is transmitted, stored or logged. You can even go offline after the page loads and it will still work.
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?
No. The tool works in any modern browser on desktop, tablet or phone. There is no account to create, no extension to add and no software to install.
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.