Free Tool

Comma Separator: Column to List and SQL IN Clause

Paste a column from Excel and get a comma-separated list as you type, or turn a list back into a column. For Salesforce and databases it writes IN clauses for SOQL or SQL, quotes escaped and long lists split. Free, in your browser, nothing uploaded.

Your Column or List

What do you want to make?

Output

Split Into Parts

Clean Up

The comma separator needs JavaScript.

How It Works

One Column In, Three Shapes Out

Paste a column straight from Excel, Google Sheets or a Salesforce report: every line is one value. A list that is already separated, or an old query with one IN clause, works too; the tool sees the separator or the clause and says how it read your text.

List joins the values with the separator and quotes you pick. Column puts each value back on its own line. IN Clause wraps the values in a clause for SOQL, SQL, SQL Server or MySQL, with every quote inside a value escaped the way that language reads it.

Excerpt: one column, three results

00123
O'Brien
Smith, John

00123,O'Brien,Smith, John
IN ('00123','O\'Brien','Smith, John')   SOQL
IN ('00123','O''Brien','Smith, John')   SQL

Try a Real Case

Each loads a list the way it comes out of a report, an export or an old query.

Escaping

One Apostrophe, Three Ways to Escape It

A list with single quotes around each value breaks the moment a value holds a quote itself: O'Brien ends the string after the O. Each language has its own fix, and the tool writes the one you pick.

SOQL uses a backslash: \' for a quote and \\ for a backslash. Salesforce’s table also lists \" for a double quote, \n, \r, \t, \b and \f, and \uXXXX for any character by its code; a backslash in any other context is an error. Standard SQL writes the quote twice, the rule the PostgreSQL, Oracle and SQLite manuals give, and the tool leaves a backslash as it is. SQL Server writes the quote twice too; a value with characters outside ASCII also gets an N in front, because Microsoft’s manual says a string without it is translated to the database’s default code page where needed, while N'…' is read as Unicode. MySQL accepts the doubled quote, but reads a backslash as an escape, so the tool doubles it, unless your server runs with NO_BACKSLASH_ESCAPES; then pick standard SQL.

  • Numbers stay unquoted only when every value is a plain number, never with a leading zero
  • Commas, ampersands and accents inside a value stay as they are
  • Rules from Salesforce’s SOQL escape sequences (opens in a new tab) and the databases’ manuals, checked November 2026

The same two values, three languages

O'Brien   C:\Temp

SOQL      'O\'Brien','C:\\Temp'
SQL       'O''Brien','C:\Temp'
MySQL     'O''Brien','C:\\Temp'
Salesforce IDs

15 or 18 Characters: One Form per Query

Every Salesforce record has one ID in two forms. Reports show 15 characters, which are case-sensitive: to Salesforce, 0035g00000AbCdE and 0035g00000abcde are two records. The API returns 18 characters, the last three recording where the capitals are, and Salesforce recommends that form.

The tool spots both forms. A list that mixes them gets a warning; one record listed in both forms counts as one, and 15-character IDs are always compared with their case, even with Ignore case ticked. Tick Write Salesforce IDs with 18 characters and every ID gets the long form; IDs whose letters Excel changed get their capitals back, because Salesforce rejects an 18-character ID whose case was changed.

One record, three spellings

0035g00000AbCdE      report, 15
0035g00000AbCdEAAV   export, 18
0035g00000abcdeaav   after Excel
→ '0035g00000AbCdEAAV'

Long Lists, Split Where You Say

A query has a length limit; this tool cuts the list into parts below the size you set.

  • 100,000characters per SOQL statement, Salesforce’s default
  • 4,000characters per string in a SOQL WHERE clause
  • 0bytes uploaded
  • Characters per part. Counts everything in the part, the query around the values included, so a whole query stays under the number you type.
  • Values per part. For a tool or a database that limits the number of values; both limits can be set at once.
  • Under the limit and still too long. Salesforce notes that a long statement can fail with QUERY_TOO_COMPLICATED below 100,000 characters, for example with many formula fields. Smaller parts help.
  • Through the REST API. The query travels in the address, and the address and headers together may be at most 16,384 bytes; Salesforce can answer a longer request with an error. Quotes and commas take more room there once encoded, so set Characters per part well below that.
  • Sources. Salesforce’s SOQL and SOSL limits (opens in a new tab) and API request limits (opens in a new tab), checked November 2026; the 100,000 does not apply to SOQL in dynamic Apex.

Make a Comma-Separated List in Four Steps

From a column in a spreadsheet to a line you can paste anywhere.

  1. 1

    Copy the Column

    Select the cells in Excel or Google Sheets, or a column of a report, and copy them.

  2. 2

    Paste It

    Paste into the field above; the result appears as you paste.

  3. 3

    Pick the Shape

    A list with your separator and quotes, a column, or an IN clause.

  4. 4

    Copy the Result

    One button per part, Copy All for every part, or a .txt file.

Comma Separator FAQ

Short answers to what people ask about turning columns into lists.

How do I convert a column from Excel into a comma-separated list?

Copy the cells in Excel and paste them into the field above. Every line becomes one value, and the list with commas appears at once; pick another separator or quotes under Output, then copy it.

How do I put single quotes around each value for SQL?

Choose IN Clause and your language. Each value gets single quotes, and a quote inside a value is escaped: doubled for standard SQL, SQL Server and MySQL, with a backslash for SOQL. For a plain list with quotes, make a List and choose Single under Quotes.

How many IDs fit in one SOQL query?

Salesforce documents a length limit for the whole statement: by default 100,000 characters. An 18-character ID takes 21 characters with its quotes and comma, so about 4,700 IDs fit, minus the rest of the query, where the query is sent as it is. Through the REST API it travels in the address, and Salesforce allows 16,384 bytes for the address and headers together, with quotes and commas taking more room once encoded, so far fewer IDs fit per part. Set Characters per part and the tool splits a longer list.

Can I turn a comma-separated list back into a column?

Yes. Choose Column and paste the list. The tool finds the separator, takes the quotes off each value and writes one value per line. It reads the values out of a pasted IN clause too.

How do I remove duplicates from the list?

Remove duplicates is ticked from the start; the result says how many went and which values repeated most. Tick Ignore upper and lower case to treat Anna@example.com and anna@example.com as one. Salesforce IDs keep their case even then.

Can Excel do this with TEXTJOIN?

Yes, in Excel 2019 and Microsoft 365: =TEXTJOIN(",", TRUE, A2:A500) joins the cells with commas and skips empty ones. It returns an error above 32,767 characters, the most a cell holds, and it neither removes duplicates nor escapes quotes.

Is my list uploaded?

No. The list is read and converted in your browser. Nothing is sent or stored, and nothing from it reaches analytics.

We Make Salesforce Marketing Work for You

Talk to a certified consultant, not a salesperson, and leave the first call knowing your next step.