Build a WHERE ... IN (...) filter from a plain list
Convert a list to a SQL IN clause whenever you have a column of IDs, usernames, or SKUs and need to query for all of them at once. Each line becomes one element of the tuple, joined with a comma and a space, wrapped in a single set of parentheses.
Values are single-quoted by default and any single quote inside a value is doubled (O'Brien becomes 'O''Brien'), which is how SQL escapes a literal quote. Switch Quotes to None when the column is numeric so you get IN (101, 102) with no quoting, or to Double quotes for engines that expect them.
Everything runs locally in your browser, so a list of customer IDs never leaves the tab. To go the other way and turn a query result back into a list, use Convert CSV to List. To wrap items in quotes without the IN clause, see Add Quotes.
How to use convert a list to a sql in clause
- 1Paste one value per line into the input panel.
- 2Pick a Quotes style: single (default), double, or none for numeric columns.
- 3Leave Prefix IN on to get a full IN (...) clause, or turn it off for just the parenthesised tuple.
- 4Turn on Dedupe to collapse repeated values before the clause is built.
- 5Copy the result straight into your query, or hit Download to save it as a .sql file.
Keyboard shortcuts
Drive ListShift without touching the mouse.
What the SQL IN clause builder does
Five concrete behaviours to know before you paste it into production.
Single quotes are doubled, not backslash-escaped
SQL escapes a literal quote by doubling it, so O'Brien becomes 'O''Brien'. The tool never emits a backslash escape, which most SQL dialects do not accept inside a standard string literal.
Blank lines and surrounding whitespace are dropped
Each line is trimmed and empty lines are skipped, so a trailing newline or an indented paste does not produce an empty '' element in the middle of your tuple.
None mode leaves values unquoted for numeric columns
Set Quotes to None and a list of IDs becomes IN (101, 102, 103). Use this only for genuinely numeric columns; unquoted text is not valid SQL.
Prefix IN is a single toggle
On, you get the full IN (...) clause to paste after a column name. Off, you get just the (...) tuple, handy when you are assembling the query in code and already wrote the IN keyword.
Dedupe collapses repeats before quoting
Turn on Dedupe and a list with the same value twice yields it once in the clause. Order of first appearance is preserved; it does not sort the values.
Worked example
Four names, single-quoted, with the quote inside O'Brien doubled so the literal stays valid.
alice bob carol O'Brien
IN ('alice', 'bob', 'carol', 'O''Brien')
Settings reference
How each option changes the output, using the sample list above as the input.
| Setting | What it does | Effect on the sample |
|---|---|---|
| Quotes: Single (default) | Wraps each value in single quotes, doubling any single quote inside | Gives 'alice', ..., 'O''Brien' |
| Quotes: Double | Wraps each value in double quotes instead | Gives "alice", "bob", ... |
| Quotes: None | Leaves values unquoted (numeric columns only) | Gives (alice, bob, ...) with no quotes |
| Prefix IN: on (default) | Prepends the IN keyword to the tuple | Output starts with IN ( |
| Prefix IN: off | Emits only the parenthesised tuple | Output is ('alice', 'bob', ...) |
| Dedupe: on | Collapses repeated values, keeping first-seen order | A value pasted twice appears once |
| Blank lines (automatic) | Trimmed and skipped | No empty element in the tuple |