YourTools.
简体中文
Back to the catalog
Tools

Split and join text

Split text at a delimiter into lines, or join lines with a delimiter, optionally quoting each item for SQL or CSV.

Process locally

Files stay in this browser session. Closing or clearing releases them.

Add text

Type or paste the text to process

Adjust settings

Optional: Operation, Delimiter, Trim each item and more

Split and join text

Run

Processes in this browser; cancel at any time

Add text first

About this tool

Join a column of values into one line with commas, or split a delimited line into one item per line. It helps when you turn IDs copied from a spreadsheet into an SQL IN list, build a CSV row, or break a tag list into lines you can sort.

Any delimiter of up to 50 characters works, including line breaks and tabs. Each item can be trimmed and wrapped in single or double quotes, and quotes inside an item are doubled, as SQL and CSV expect. Up to 1 MB of text is processed in your browser and is not uploaded.

How to use it

  1. Paste your text, or select Use example to load three lines.
  2. Choose an “Operation”, “Join lines” or “Split into lines”, and type the “Delimiter”.
  3. Leave “Trim each item” and “Drop empty items” on to clean up the items, and choose how to “Quote items” if needed.
  4. Select Run, then preview the result (join.txt or split.txt) and download it.

Formats and limits

Input
Text
Output
Plain text
Size limit
1 MB
Settings
Operation (Join lines, Split into lines); Delimiter; Trim each item; Drop empty items; Quote items (No quotes, Single quotes, Double quotes)
Privacy
Files stay in the current browser session. No file bytes are uploaded.
Price
Free, no sign-up

Common questions

How do I turn a column of IDs into an SQL IN list?

Choose “Join lines”, set the delimiter to a comma (or a comma and a space) and pick “Single quotes ('a')”. The lines apple, banana and O'Brien become 'apple','banana','O''Brien'; add the brackets around the list yourself.

How do I use a line break, a tab or a backslash as the delimiter?

Type \n for a line break and \t for a tab. For a backslash itself, type \\, so \\n means a backslash followed by the letter n.

My text uses Chinese commas. Why is nothing split?

The delimiter is matched exactly as typed, so an English comma does not match ,or 、. Type the Chinese mark into “Delimiter”; it is plain text, not a regular expression, and may be several characters long.

What happens with an empty delimiter?

When splitting, every character goes on its own line. When joining, the lines are put together with nothing between them.

Why did empty lines or spaces disappear?

“Trim each item” removes spaces at both ends of every item and “Drop empty items” removes items that end up empty; both are on by default. Turn them off to keep the items exactly as they are.