EditSafely

Convert CSV Columns to an Array

Create an array from one or more CSV columns.

Runs on your device, nothing uploaded

With several columns
Quote style
Try:

0 chars · 0 lines

Output

Create an array from one or more CSV columns.

Type or paste above to see the result here.

Example: The age column as a JSON array

What you paste never leaves this tab

Convert CSV Columns 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 Columns to an Array

  1. 1. Paste your CSV. Drop the comma-separated rows into the input pane. The chosen columns are collected into a JSON array, useful for pasting straight into code or an API request body.
  2. 2. Choose which columns to extract. Tap column names in the chips or the input table, or leave Columns empty for every column. With several columns you get one array per column keyed by its name, or pick One flat array.
  3. 3. Set the header and type options. Leave the Header row box under the input checked to exclude it from the array. Numbers as numbers keeps digits and true/false as real values. Quote style writes JSON, JavaScript single quotes or Python literals.
  4. 4. Copy the JSON array. Copy the resulting array and paste it directly into a script, a config file, or anywhere a JSON array of values is expected instead of a full CSV table.

When to use Convert CSV Columns to an Array

Convert CSV Columns to an Array pulls one or more columns out of a CSV and formats their values as a proper JSON array, typed as numbers when appropriate. Use it when you're moving specific values from a spreadsheet directly into code.

  • Hardcoding a list of prices into a script. You maintain product prices in a spreadsheet and need them as a JSON array of numbers inside a JavaScript file. Extracting the column with number conversion gets you exactly that.
  • Building a test fixture array. A unit test needs an array of sample IDs pulled from a CSV of test data. Converting the ID column saves manually typing out each value with commas and brackets.
  • Passing values into an API request body. An API endpoint expects an array field, and the values live in a spreadsheet column. Extracting them as a typed JSON array lets you paste them straight into the request.

Examples

The age column as a JSON array

Input

name,age
Ada,36
Grace,45

Output

[36, 45]

Two columns as an object of arrays

Input

name,age
Ada,36
Grace,45

Output

{
  "name": ["Ada", "Grace"],
  "age": [36, 45]
}

About the Convert CSV Columns to an Array tool

Convert CSV Columns to an Array is a free online tool that works entirely inside your web browser. Create an array from one or more CSV columns. 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 5 settings, including Columns (numbers or names, empty = all), With several columns, Quote style and First row is header (skipped), 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.

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

Is Convert CSV Columns 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.

Related tools

All CSV Tools →