SQL IN Clause Generator

Paste a list of values, one per line, and build a SQL IN (...) or NOT IN (...) clause — with quoting, a column name, and long lists split into groups of 1,000.

Result
IN ('apple', 'banana', 'cherry')

🔒 Built in your browser — nothing is uploaded.

Turn a list into a SQL IN clause

Copy a column of values out of a spreadsheet, a log file, or a text document, paste them one per line, and this tool assembles a ready-to-run IN (...) clause you can drop straight into a WHERE statement. Blank lines are ignored and every value is trimmed of surrounding whitespace, so messy pasted data still produces a clean, comma-separated list. The output updates live as you type and copies with one click.

Quoting, escaping, and column names

Toggle Quote values on for text columns and each value is wrapped in single quotes; leave it off for numeric columns to emit bare numbers like IN (1, 2, 3). Single quotes inside a value are safely escaped by doubling them, so O'Brien becomes 'O''Brien' instead of breaking your query. Add an optional column name to get a complete predicate such as status IN ('active', 'pending'). Tick Exclude values (NOT IN) for the opposite predicate, and Split large lists into multiple IN() groups when a database caps the list — Oracle stops at 1,000 — to break it into several clauses of at most that many values (1,000 by default, and you can change it). Splitting needs a column name, because the groups are combined into one predicate: joined with OR for IN, and with AND for NOT IN.

Frequently asked questions

Is my list of values uploaded anywhere?

No. The clause is built entirely in your browser with JavaScript. Your values never leave your device and nothing is sent to a server, so even sensitive IDs or emails stay private.

How are single quotes inside a value handled?

When quoting is on, any single quote inside a value is escaped by doubling it, following standard SQL string rules. For example O'Brien is output as 'O''Brien', which is safe to paste into most SQL databases.

Should I quote values for numeric columns?

No. Turn off Quote values so numbers are emitted bare, like IN (1, 2, 3). Turn it on only for string, date, or other text columns that require single quotes.