SQL IN Clause Generator

Splits on newlines, commas, semicolons or tabs. Embedded single quotes are doubled, and the list is chunked into OR'd clauses so it stays under Oracle's 1000-item limit.

5 value(s), 1 duplicate(s) removed.

SQL IN Clause Generator — Free Online Tool

Turns a pasted list of values into a SQL IN clause, splitting on newlines, commas or tabs, detecting whether the values are numeric or need quoting, escaping embedded single quotes, removing duplicates and blanks, and chunking the output into several OR'd clauses so it stays under Oracle's 1000-item and SQL Server's parameter limits.

How to use the SQL IN Clause Generator

  • Open the tool above — it runs entirely in your browser, so your input never leaves this page.
  • Paste or type your input into the field, then press the relevant button (e.g. Encode / Decode, Generate, or Convert).
  • Copy the result from the output area with the copy button orCtrl/Cmd + C.
  • No signup, no upload, and no tracking — repeat as often as you need.

Frequently asked questions

Why does it split the list into several clauses?

Oracle raises ORA-01795 above 1000 items in a single IN list, and SQL Server has a practical parameter ceiling. Chunking into OR'd clauses wrapped in parentheses keeps the semantics identical while staying under both.

How are quotes inside values handled?

A single quote is doubled — O'Brien becomes 'O''Brien' — which is the portable escape in every major dialect. That said, a generated literal list is for ad-hoc queries; use bound parameters for anything user-supplied.

Why is NOT IN joined with AND instead of OR?

Because negation flips the connective. x NOT IN (a) OR x NOT IN (b) is true for almost everything, while AND correctly excludes both chunks. Also note that NOT IN never matches when the list contains NULL.

Free & private — why use this SQL IN Clause Generator

The SQL IN Clause Generator runs 100% client-side in your browser. Your data is never uploaded to a server, no account is required, and the tool is completely free. It works offline once the page has loaded and is part of a growing collection of privacy-first developer utilities.

More developer utilities