Skip to content
Free developer tool

SQL IN list builder

This tool turns a column of IDs, emails or names into a ready-to-paste SQL IN clause. Analysts and developers use it to filter a query by a list copied from a spreadsheet, ticket or log.

  • Runs in your browser
  • Free, no account needed
  • Copy or download the result

Your input

47 characters

Leave empty for just the list
Quoting
Auto leaves plain numbers bare
Split on
Auto splits lines, or commas on one line
Duplicates
0 keeps one list; Oracle allows 1,000

Result

customer_id IN ('C-10482', 'C-10519', 'C-10533', 'C-10577', 'C-10602')
Values
5 (1 duplicate removed), quoted as strings

The short answer

A SQL IN list tests whether a column matches any value in a set, written as column IN (value1, value2). Text values go in single quotes, and a single quote inside a value is doubled. Numbers can stay bare, but codes with leading zeros are quoted to keep the zeros.

Formulacolumn IN ('value1', 'value2', ...), with each single quote inside a value doubled

Worked exampleThe 6 customer IDs include C-10519 twice, so with duplicates removed the tool writes customer_id IN ('C-10482', 'C-10519', 'C-10533', 'C-10577', 'C-10602') with 5 values quoted as strings.

Example

Input
C-10482
C-10519
C-10533
C-10519
C-10577
C-10602
Result
customer_id IN ('C-10482', 'C-10519', 'C-10533', 'C-10577', 'C-10602')
Values
5 (1 duplicate removed), quoted as strings

How to use the sql in list builder

  1. Paste your values into the Values box, one per line or separated by commas.
  2. Set the Column, such as customer_id, or clear it to get only the (...) list.
  3. Choose Quoting, Split on, Duplicates and an optional Chunk size.
  4. The result updates as you type (Run also works). Use Copy result or Download to save it.

How it works

Each value is trimmed and empty values are skipped. In Auto split mode, a list on several lines is split by line, and a single line is split by commas.

Auto quoting leaves values bare only when every value is a plain number. Numbers with leading zeros, such as the ZIP code 02134, are quoted so the zeros are kept.

Single quotes inside values are doubled, so O'Brien becomes 'O''Brien'.

Remove duplicates keeps the first copy of each value and is case sensitive. A Chunk size such as 1000 splits the list into several IN lists joined with OR, because Oracle allows at most 1,000 items in one list.

The column name must be a plain identifier like orders.id or a quoted name. Up to 100,000 values are accepted.

Everything runs in your browser. Your input is not uploaded or stored. If you use Copy link, what you entered is placed in the link.

Questions and answers

How many values can a SQL IN list have?

Oracle allows at most 1,000 expressions in one IN list. Other databases allow more, but very long lists can be slow, so a temporary table may work better.

Should numbers be quoted in an IN clause?

Not for numeric columns. For text columns that hold digits, such as ZIP codes, set Quoting to Always.

Is this safe from SQL injection?

Quotes are escaped, but in application code you should use parameterized queries instead of building SQL from text.

Is my list uploaded?

No. It runs in your browser, and nothing you paste is sent to a server.

Last updated November 1, 2026. Maintained by SnowRock. How our tools work

All 220 SnowRock tools