Skip to content
gohacks.dev
Tooling

Split Text and Join Lines

Split text on a comma or any delimiter into one item per line, or join lines with a delimiter, with trimming, empty-item removal and quoting.

Free · No sign-up · Your inputs stay in your browser

Input

Split text by a delimiter or join lines

Output

One per line

5 items

In a shell: tr ',' '\n' < file splits, and paste -sd, file joins lines with commas. An empty delimiter splits into single characters, by code point, so an emoji stays whole.

Runs in this browser. Nothing you paste is sent to a server.

Everyday conversions

A comma-separated list from a config value into lines to sort and dedupe; a column copied from a spreadsheet into a quoted, comma-separated list for code; hostnames into a space-separated list for a loop. For SQL IN clauses and language-specific arrays, the list converter writes the exact syntax.

In a shell

tr ',' '\n' < file splits on commas, and paste -sd, file joins lines with commas.

Share

Frequently asked questions

How do I split text into characters?
Leave the delimiter empty. Characters are split by code point, so an emoji stays in one piece.
How do I turn a column into a comma-separated list?
Paste the column, choose Join lines with a comma as the delimiter, and optionally wrap items in quotes.
Is what I paste sent anywhere?
No. The tool runs entirely in your browser with JavaScript. Nothing you type or paste is sent to our server or stored.

Keep planning

Similar tools