SQL IN Clause Builder

Turn a list of values into a ready-to-paste SQL IN (...) clause.

Ad placeholder (leaderboard)
Enjoying the tools? Go Pro for £4.99 (one-time) and remove all ads — forever, on this device. Remove ads — £4.99

Have a column of IDs from a spreadsheet, log, or query result and need them inside a WHERE id IN (...)? Paste the list and this tool assembles a clean, correctly quoted SQL IN clause ready to drop into your query.

How it works

The builder runs a small pipeline:

  1. Split the input on newlines, commas, semicolons, or tabs, trim each piece, and drop empties.
  2. De-duplicate (optional) by keeping the first occurrence of each value.
  3. Quote each value. In auto mode, anything matching a clean number pattern stays bare and everything else is wrapped in single quotes with ' escaped as ''. You can also force always-quote or never-quote.
  4. Assemble column IN (...) — or NOT IN if toggled — joining values inline, or one per indented line in multiline mode.

Example

Pasting 1001, 1002, 1002, 1007 with column id, auto quoting, de-dupe on:

id IN (1001, 1002, 1007)

A list of strings like GB, US, FR becomes:

country IN ('GB', 'US', 'FR')
OptionEffect
Auto quotingNumbers bare, strings single-quoted
De-duplicateRemoves repeated values
NOT INSwaps IN for NOT IN
MultilineOne value per indented line

Everything runs in your browser — nothing is uploaded.

Ad placeholder (rectangle)