Skip to main content

Text to SQL List Converter

API reference

Turn a column of values or a comma-separated list into a SQL list for an IN (...) clause. Quotes and escapes each item, leaves numbers bare, removes duplicates and blanks, and wraps the result in a ready-to-paste WHERE column IN (...) snippet.

Input

One value per line, or separated by commas, semicolons or tabs.

Leave numeric values bare (42) or quote them like everything else ('42').

Output

SQL List
Was this helpful?

More ways to use this tool

REST API

curl -X POST https://api.iotools.cloud/v1/tool/text-to-sql-list-converter \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "inputText": "apple\nbanana\n42\nO'Brien\napple",
    "delimiter": "auto",
    "quote": "single",
    "numbers": "unquoted",
    "dedupe": "true",
    "trim": "true",
    "wrap": "in",
    "columnName": "name",
    "layout": "single"
  }'

Swap in your own key from your account. The tool's fields are the body — no wrapper.

Ask an AI agent

Use the IOTools `text-to-sql-list-converter` tool (Text to SQL List Converter) on this input:

YOUR_INPUT_HERE

Paste this at any agent connected to the IOTools MCP server, then add your input.

Embed widget

<iframe
  src="https://iotools.cloud/embed/text-to-sql-list-converter/"
  width="100%" height="520" frameborder="0" scrolling="no" loading="lazy"
  title="Text to SQL List Converter — iotools.cloud"
  sandbox="allow-scripts allow-forms allow-same-origin allow-downloads allow-popups allow-popups-to-escape-sandbox"
  allow="clipboard-write"
  style="width:100%;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden"></iframe>
<script src="https://iotools.cloud/embed.js" async></script>

Drop this into your own page — free, no key required, just a link back.

Cost per API/MCP callFrom 5 credits
Need more credits?View pricing

Also available with

Guides

Paste a column from a spreadsheet, a list of IDs, or a comma-separated string and get a SQL list you can drop straight into an IN (...) clause. Everything runs in your browser, so the data you paste never leaves your device.

How to use it

  1. Paste your values — one per line, or separated by commas, semicolons or tabs. Auto separator handles all of these at once.
  2. Choose a quote style. Single quotes are standard SQL; backticks suit MySQL identifiers; No quotes is useful for numeric IDs.
  3. Pick a wrapper: plain parentheses, WHERE column IN (...), or WHERE column NOT IN (...), and set the column name.
  4. Copy the result.

What it handles for you

  • Escaping: a single quote inside a value is doubled (O'Brien becomes 'O''Brien'), the standard SQL rule.
  • Numbers: numeric values stay bare (42) by default, so integer columns compare correctly. Switch to Quote like text if your column is a string type.
  • Cleanup: trims whitespace, drops blank items and removes duplicates, with a count of what was removed.
  • Layout: single line, or one item per line for long lists.

Note on safety

This is for ad-hoc queries. In application code, use parameterized queries instead of building SQL strings from user input.

sqlin clauselisttext to sqlcomma separatedquotewhere incolumn to listdatabase

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.