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
Run
Processes in this browser; cancel at any time
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
- Paste your text, or select Use example to load three lines.
- Choose an “Operation”, “Join lines” or “Split into lines”, and type the “Delimiter”.
- Leave “Trim each item” and “Drop empty items” on to clean up the items, and choose how to “Quote items” if needed.
- 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.
Related tools
Line tools: trim, dedupe, sort
In one pass: trim lines, remove empty or duplicate lines, count repeats, filter by length, sort (including natural and pinyin order) and add a prefix or suffix.
Reverse text
Reverse the characters of text or of each line, the order of lines or words, or the items of a list or JSON array; emoji stay whole.
Wrap lines to a fixed length
Break every line into pieces of at most a set number of characters or display columns, optionally only between words.
Text beautifier
Add a space between Chinese and English or numbers, optionally switch to Chinese punctuation and tidy paragraphs and spaces.
Letter case and naming styles
Change letter case line by line, or turn phrases and identifiers into camelCase, PascalCase, snake_case, kebab-case or CONSTANT_CASE.
Compare text
Compare two texts line by line with line numbers, and download a unified diff and a JSON report.