Lines to Array

Line to Array Converter

Turn copied columns, log excerpts, keyword lists, and TXT files into arrays.

Convert the lines

Lines and delimited text to array builder

0 items / 0 unique
Input Text
0 characters Ctrl+Enter to convert - Drag and drop .txt
Split Input By
Cleaning Options
Output
Output Format
JSON options
Customization
Output 0 unique Output
// Your converted output will appear here.
Paste text and click Convert Text, or use Ctrl+Enter.
Your text stays private. All conversion happens locally in your browser using JavaScript. Nothing is uploaded to any server.

New Line is the default and handles Windows CRLF or Unix LF endings; you can also split by commas, semicolons, spaces, tabs, or a custom delimiter.

How It Works

How to use the Line to Array Converter

  1. Paste or drop a TXT file

    Drag a .txt file onto the input box and it is read in your browser — nothing is uploaded.

  2. Choose how the input is split

    Keep New Line for one value per line, or choose comma, semicolon, space, tab, or a custom delimiter. Empty values are removed by default.

  3. Copy the array

    JSON by default. Switch formats from the row above the preview.

Examples

Line to Array Converter examples

A copied column

Input

SKU-1001
SKU-1002
SKU-1003

Output

[
  "SKU-1001",
  "SKU-1002",
  "SKU-1003"
]

Blank lines between groups

Input

first


second

Output

[
  "first",
  "second"
]

Turn off Remove empty values to keep the blanks as empty strings.

Notes

Working with line to array

CRLF, LF, and the invisible carriage return

Windows ends lines with a carriage return and a line feed; Unix and macOS use the line feed alone. Splitting on the line feed only leaves a trailing carriage return on every value from a Windows file — invisible on screen, and enough to make a value fail to match its twin forever. This tool splits on either, so no carriage returns survive.

Trailing whitespace from copied columns

Spreadsheet cells often carry trailing spaces you cannot see. Trim spaces is on by default, which is almost always what you want. It also means a line of nothing but spaces becomes empty and is then dropped by Remove empty values.

Comma, semicolon, tab, space, and custom delimiters

New Line remains the fastest choice for copied columns and TXT files. Choose another delimiter when the values share one line, including a custom character such as a pipe. For word, character, or regular-expression splitting, use the String to Array Converter.

Lines with bullets or numbering

If your lines start with a dash, an asterisk or a number, they are a formatted list rather than plain values. The List to Array Converter strips those markers; this page keeps them as part of each value.

FAQ

Line to Array Converter FAQs

Turn lines or delimited text into the output you need

Paste or upload the source, choose its delimiter, and copy the result in your preferred format. For advanced word, character, or regular-expression splitting, use the String to Array Converter. To turn an existing array back into lines, use the Array to Text Converter.