How to use
- Paste your column. It can come from Excel, Google Sheets, a SQL result, a log file or any text editor; each line is one item.
- Pick an output shape. Click a preset chip (SQL IN, JSON array, Python list…) or set the separator and wrappers by hand in the options panel.
- Tidy the list if you need to. Remove duplicates, sort A–Z or numerically, change the letter case, or reverse the order.
- Copy or download. The result updates as you type; Ctrl+Enter in the input box copies without reaching for the mouse.
Example: what each preset produces
Starting from the three-line column apple, banana, cherry, each preset gives you a different, ready-to-paste result:
| Preset | Output | Typical use |
|---|---|---|
| No spaces | apple,banana,cherry | CSV cells, URL query strings |
| Plain | apple, banana, cherry | Sentences, emails, tags fields |
| SQL IN | ('apple', 'banana', 'cherry') | WHERE id IN (…) clauses |
| JSON array | ["apple", "banana", "cherry"] | API payloads, config files |
| Python list | ['apple', 'banana', 'cherry'] | Scripts and notebooks |
| Semicolon | apple; banana; cherry | Outlook / Exchange recipient lists |
| Pipe | apple | banana | cherry | Markdown tables, log filters |
| Regex OR | (apple|banana|cherry) | Alternation patterns in search tools |
Common situations where this saves time
Building a SQL IN list
You have a column of IDs from a report and need to query those exact rows. Paste the IDs, click SQL IN, and drop the result straight after WHERE id IN. Each value becomes a quoted string, and a quote inside a value is doubled, so a name like O'Brien stays one value instead of ending the string early. For numeric IDs you may prefer no quotes at all; use the Plainpreset and wrap the whole list in parentheses:
SELECT * FROM orders WHERE customer_id IN (1042, 1043, 1044);Addressing an email to a list of people
Most mail clients accept addresses separated by commas; Outlook traditionally expects semicolons. Paste the address column, choose the matching preset, and paste the result into the To or BCC field. Tick Remove duplicates first so nobody receives the message twice.
Turning spreadsheet rows into code
Product SKUs, country codes, feature flags: data often starts life in a spreadsheet and needs to end up in an array. The JSON array and Python list presets add the right quotes and brackets so the result parses on the first try; paste the result into the JSON Formatter if you want it validated.
Options explained
- Presets (No spaces, Plain, SQL IN, JSON array, Python list, Semicolon, Pipe, Regex OR) fill the separator and wrapper boxes in one click. No spaces is what the page starts on. The highlighted chip is the preset that matches the current settings; edit any box by hand and the highlight clears.
- Between items is the separator: Comma only (the default), Comma + space, Semicolon + space, Semicolon only, Pipe with spaces, Pipe only, Space, Tab, New line, or Custom… for anything you type, including several characters such as
::. - Wrap each item: Before / After adds text around every item, e.g.
'and'for SQL string literals. - Quotes inside items decides what happens to a quote inside a value when the After box is a single
',"or`. Auto (the default) follows the preset: SQL IN doubles it, JSON array and Python list put a backslash before it (and double any backslash). Double them and Backslash force one rule; Leave as is changes nothing. Clicking a preset sets it back to Auto. - Wrap whole list: Start / End adds text once at the beginning and end, e.g.
(and). - Trim spaces around items (on by default) removes leading and trailing spaces and tabs from each line before anything else happens.
- Skip blank lines (on by default) drops lines that are empty after trimming and reports them as dropped. Untick it to keep them as empty items:
a, , b. - Remove duplicates keeps the first occurrence of each item; …ignoring letter case makes
Apple,appleandAPPLEcollapse to whichever was written first. - Reverse order is applied last, after sorting, so A → Z plus Reverse gives the same result as Z → A.
- Sort: A → Z and Z → A use natural order (
item2beforeitem10, case-insensitive); Numeric, low → high and high → low parse each item as a number; Shortest first and Longest first order by length and break ties alphabetically. - Letter case: Keep as is, lowercase, UPPERCASE, or Title Case. Case is applied before duplicates are removed, so lowercase plus Remove duplicates merges
Appleandapple. - Copy to clipboard, Download .txt, and Split back to column →, which opens the reverse tool with this result already loaded.
Edge cases and common errors
- Quotes inside values are escaped the way the target language expects.
O'Brienwith the SQL IN preset produces('O''Brien', 'Smith')(SQL doubles a quote), with the Python list preset['O\'Brien', 'Smith'], andsay "hi"in a JSON array becomes["say \"hi\""]. Doubling would be wrong in Python:'O''Brien'is two strings side by side, which Python silently joins intoOBrien. - Quotes you type into the wrap boxes yourself are not escaped on Auto. A hand-made wrapper matches no preset, so the tool can't tell which language it is for, and
O'Brienbetween'and'stays'O'Brien'. Choose Double them or Backslash under Quotes inside items. Changing only the separator keeps Auto working, e.g. SQL IN with Comma only. - Values containing the separator: a line such as
Smith, Johnbecomes two items to anything that reads the output as CSV. Choose a separator that does not occur in the data (Pipe or Tab), or wrap each item in quotes. - Numeric sort reads the first number it can find after stripping everything except digits,
.and-:$42sorts as 42,1,234.5as 1234.5, and lines with no digits go last. Version strings do not work this way.v2.10reads as 2.1 and sorts asv2.10,v2.1,v2.9. Use A → Z instead, which compares digit runs naturally:v2.1,v2.9,v2.10. - A trailing newline counts as a blank line. Three lines followed by Enter shows “2 items · 1 dropped”; nothing is missing, the final empty line was skipped.
- Windows line endings (
\r\n) and old-Mac\rare recognised, so pasting from any editor works. - Tabs inside a line are kept. Two spreadsheet columns copied together arrive as
a[tab]bper line and become one item each. Copy a single column at a time. - Title Case here is the simple first-letter rule:
o'neil mcdonaldbecomesO'neil McdonaldandUSAbecomesUsa. For style-guide capitalisation, run the result through the Title Case Converter. - Input made only of blank lines produces an empty result and the counter reports every line as dropped; a completely empty box shows “0 lines” and nothing else.
Do the same job in a spreadsheet or in code
Excel and Google Sheets
The TEXTJOIN function joins a range with a separator and can skip blank cells:
=TEXTJOIN(", ", TRUE, A1:A100)To add quotes around every value, wrap the range in a text expression first:
=TEXTJOIN(", ", TRUE, "'" & A1:A100 & "'")Python
lines = [l.strip() for l in text.splitlines() if l.strip()]
result = ", ".join(lines)Command line
paste -sd, column.txt # Linux / macOS
(Get-Content column.txt) -join ", " # PowerShell