SQL IN Clause Generator & List Formatter
Generate a SQL IN() clause from any list in seconds, paste values one per line, pick a preset (strings, integers, NOT IN, CSV, Python list, JS array), and copy. Trim, dedupe, sort, and wrap the output however your query needs it. Nothing leaves your browser.
Format: 'value', 'value'
Understanding the SQL IN Clause
A SQL IN clause is a WHERE condition that matches a column against a fixed list of values in one expression, using the syntax WHERE column IN (...). It is equivalent to writing multiple OR predicates but far more readable and often better optimised by the query planner.
String values, use single quotes
SELECT * FROM orders
WHERE status IN ('pending', 'processing', 'shipped');Integer values, omit quotes
SELECT * FROM users WHERE id IN (101, 202, 303, 404);
NOT IN, exclude a list
SELECT * FROM products
WHERE category NOT IN ('archived', 'draft');Works identically in MySQL, PostgreSQL, SQL Server, SQLite, BigQuery, and Snowflake, single-quoted string literals are the ANSI SQL standard.
How to Use
1. Paste your list
Copy a column from Excel, Google Sheets, a database result, or any text source. Each line becomes one item.
2. Pick a preset or configure
Choose SQL IN (strings), SQL IN (integers), NOT IN, CSV, Python list, JS array, or dial in wrap + delimiter manually.
3. Copy and use
Hit Copy to Clipboard. Paste directly into your SQL query, script, or config file.
Preset Reference
| Preset | Wrap | Delimiter | Example output |
|---|---|---|---|
| SQL IN (strings) | ' | , | 'a', 'b', 'c' |
| SQL IN (integers) | none | , | 1, 2, 3 |
| SQL NOT IN | ' | , | 'a', 'b', 'c' |
| CSV | none | , | a,b,c |
| Quoted CSV | " | , | "a","b","c" |
| Python list | ' | , | ['a', 'b', 'c'] |
| JS array | " | , | ["a", "b", "c"] |
Common Use Cases
SQL WHERE IN(), ad-hoc queries
Export an ID column from a spreadsheet or BI tool, paste it here, and get a ready-to-paste IN clause for MySQL, PostgreSQL, SQL Server, BigQuery, or Snowflake.
Column to CSV / comma-separated list
Turn a vertical column of values into a single comma-separated line for API payloads, import configs, or spreadsheet COUNTIF formulas.
Python & JavaScript data structures
Generate a Python list literal or a JavaScript array literal directly from a pasted column, ready to drop into code.
Data cleanup before import
Deduplicate and trim a messy list of SKUs, emails, or tags before feeding them into a database, API, or ETL pipeline, the stats bar confirms the final count.
Database Limits on Very Large IN Lists
An IN clause built from a pasted spreadsheet column can easily reach thousands of values, and some databases put a hard cap on how many literals it can hold:
Oracle: 1,000-item limit
Oracle raises ORA-01795 (Oracle docs) if a single IN list has more than 1,000 literal values. Split the list into batches of 1,000 joined with OR, or load the values into a temporary table and use a JOIN instead.
SQL Server: 2,100-parameter limit
When values are passed as bound parameters (not inline literals), SQL Server caps a single request at 2,100 parameters total (Microsoft docs). A table-valued parameter or a temp table avoids the limit for large batches.
MySQL, PostgreSQL, SQLite
No fixed item-count limit on IN lists, but very large lists (tens of thousands of values) can still slow the query planner. If the list came from another table, a JOIN or a subquery is usually faster than a huge literal IN list.
General rule of thumb
An IN list of a few hundred values is fine everywhere. Once you are pasting thousands of IDs regularly, it is worth loading them into a temp table or a CTE instead of regenerating a giant literal list each time.
Frequently Asked Questions
How do I generate a SQL IN clause from a list of values?▾
How do I generate a SQL NOT IN clause?▾
Should I use quotes in a SQL IN clause for numeric IDs?▾
How do I convert a spreadsheet column to a comma-separated list?▾
Can I remove duplicate values before joining?▾
How do I create a Python list or JavaScript array from a column?▾
Can I use a custom delimiter or wrap character?▾
Is my data safe? Does anything get sent to a server?▾
What is the maximum list size this tool can handle?▾
Does the database itself have a limit on how many values an IN clause can hold?▾
By Toolember · Updated September 2026