Data Tools / SQL

SQL IN Clause Generator

Create SQL IN or NOT IN clauses from lists of IDs, numbers, text values, spreadsheet columns, or other data. Format, clean, quote, deduplicate, and copy the result instantly.

  • Free
  • No signup
  • No ads
  • Runs in your browser
SQL workspaceReal-time formatting
Paste one or many values

Use new lines, commas, tabs, semicolons, or pipes.

0 characters
e.g. id or users.id; quoted identifiers also accepted.
Ready to copy
Paste values to generate SQL.● Local
Advanced options
OR combines matching IN conditions.

Automatic type detection quotes mixed text/number lists. Single quotes are the standard SQL string format. Double quotes and unquoted text are not portable SQL string literals. Chunking requires a column name; for NOT IN, chunked conditions must be joined using AND.

Input values0
Unique values0
Duplicates removed0
Output length0

Your data stays in your browser. DevBinly processes your values locally with JavaScript. SQL values and lists are not uploaded to our server.

Independent and ad-free

Saved you some time? ☕

DevBinly is free, has no ads, and this tool runs locally in your browser. If it helped with your workflow, you can support continued development.

Buy Me a Coffee
Quick guide

How to Generate a SQL IN Clause

  1. Paste IDs, names, or spreadsheet values into the input box.
  2. Choose text, numbers, or automatic detection.
  3. Enter a SQL column name if you want a complete condition.
  4. Choose IN or NOT IN.
  5. Adjust cleanup and formatting options as needed.
  6. Copy or download the generated SQL.
Reference

SQL IN Clause Examples

Numeric IDs
WHERE id IN (101, 102, 103)
Company names
WHERE company IN ('Apple', 'Google', 'Microsoft')
Escaped apostrophe
WHERE publisher IN ('O''Reilly', 'Microsoft')
Exclusion filter
WHERE status NOT IN ('cancelled', 'deleted')

Common Uses

  • Convert Excel or Google Sheets columns into SQL values
  • Build ID filters from query results or CSV data
  • Remove duplicate IDs before running queries
  • Prepare SQL filters for MySQL, PostgreSQL, SQL Server, SQLite, or Oracle
  • Create exclusion lists using NOT IN
  • Split large lists into manageable groups

What Is a SQL IN Clause?

The SQL IN operator checks whether a value matches any item in a list. It is often a concise alternative to several OR equality comparisons.

SELECT *
FROM users
WHERE id IN (101, 102, 103);

SQL IN vs NOT IN

IN keeps rows that match; NOT IN excludes matching values.

WHERE country IN ('US', 'CA')
WHERE status NOT IN ('deleted', 'blocked')

Be careful with SQL NULL: comparisons involving NULL use three-valued logic, and NOT IN can behave unexpectedly when its set includes NULL.

String Escaping & Query Safety

Standard SQL escapes apostrophes by doubling them: O'Reilly becomes 'O''Reilly'. The tool applies this when single-quote formatting is selected.

For application queries with untrusted input, use parameterized queries or prepared statements instead of concatenating generated snippets into SQL.

Questions answered

Frequently Asked Questions

Practical answers about SQL list formatting.

What is a SQL IN clause?

An IN condition checks whether a value matches any member of a specified list, such as WHERE id IN (101, 102).

How do I convert a list into a SQL IN clause?

Paste newline-, comma-, tab-, semicolon-, or pipe-separated values, choose the value type, and copy the generated clause. Add a column name to generate a full SQL condition.

Should numbers have quotes in SQL IN clauses?

Normally numbers are written without quotes, while text uses single quotes. Auto detect leaves clearly numeric lists unquoted and treats mixed lists as text.

How are apostrophes handled?

With the default single-quote style, O'Reilly is escaped as 'O''Reilly'.

Can I create a NOT IN clause?

Yes. Select NOT IN. When splitting one NOT IN condition into chunks, the tool joins those conditions with AND to preserve exclusion behavior.

Can I paste values from Excel or Google Sheets?

Yes. Copy a column or tab-separated cells and paste them directly into the input box.

Does DevBinly upload my SQL data?

No. This tool formats your input entirely with JavaScript in your browser. It does not send the pasted data to DevBinly.

Can I remove duplicates?

Yes. Duplicate removal is enabled by default, and advanced settings let you compare values with or without case sensitivity.

Can I generate SQL for large lists?

Yes. Large lists are supported within browser memory limits. Advanced chunking lets you group values into 100, 500, 1,000, or a custom number of values per condition.