WuseBox ← Back to tools

BazoZmiana

SQL IN List Formatter – Excel column to WHERE IN ('a','b')

Paste objects and generate a list ready to use in a query, for example in the clause IN (...).

Object separators
Custom:

Checked characters separate objects. Uncheck a separator to keep it inside objects (e.g. uncheck Space for values like “Jan Kowalski”). Order and duplicates are preserved.

Result

Paste objects and click “Generate”.


    
Database List Splitter

Paste a list in parentheses with objects in single quotes, separated by commas.

Objects on separate lines

Paste a database list and click “Split objects”.

How to quickly format an Excel list of values for an SQL IN (...) query

Working with relational databases (PostgreSQL, MySQL, MS SQL, Oracle, SQLite) often requires filtering records using a list of identifiers provided by a client or business team. Developers and analysts typically receive these values as an Excel column, CSV file, email report, or system log excerpt.

Manually adding quotes, commas, and parentheses for many identifiers ('id1', 'id2', 'id3') is time-consuming and error-prone. SQL IN List Formatter converts values separated by spaces, tabs, or new lines into a list ready to use in a clause WHERE column IN (...). When building queries in an application, use query parameters instead of inserting untrusted data directly into SQL.

SQL IN clause: Syntax, optimization, and database engine limits

The IN (...) construct compares a column value with a list of allowed values, replacing multiple OR:

  • Text identifiers (strings / UUID / varchar): Each value needs single quotes and commas between items. SQL IN List Formatter formats text values and escapes apostrophes within list items.
  • Numeric identifiers (integers / bigint): can be formatted as a comma-separated list without quotes, ready for database consoles such as DBeaver, DataGrip, pgAdmin, or phpMyAdmin.
  • Database engine limits: Some databases limit the number of items in an IN. Oracle Database limits it to 1,000 items (ORA-01795). For larger sets, consider splitting them into batches, using temporary tables, or using a JOIN.

Transforming data both ways: From database to report and back

SQL IN List Formatter supports two common data transformation workflows for developers and analysts:

  • From spreadsheet to SQL: Copy a column of product codes, order numbers, or user IDs from Excel or Google Sheets to quickly create a formatted list.
  • From query result to a vertical list: Split comma- or semicolon-separated values into separate lines and paste them into a spreadsheet or text editor.
  • Preserving order and duplicates: The order of items and all duplicates are preserved, making it easier to compare with the source report.

Security and confidentiality of business data (100% client-side)

When working with database data, it is important to protect confidential information and follow IT security policies and GDPR requirements:

  • Browser-only processing: Pasted identifiers, logs, and transaction data are formatted locally and are not sent by the tool to external APIs.
  • Lists are not sent to a server: The tool does not send field contents to a server. Data remains in the active tab and is cleared from its memory when the tab is refreshed or closed.
  • Use in corporate environments: You can format lists on corporate networks (intranet, VPN) while keeping the data in your browser.

Frequently asked questions (FAQ)

How do I prepare data copied from an Excel spreadsheet?

Select the desired column in your spreadsheet, copy it (Ctrl+C / Cmd+C), and paste it into the “Objects” field. New lines and tabs are recognized as record separators.

Does SQL IN List Formatter remove duplicates from a list of values?

No. SQL IN List Formatter preserves the order and all duplicates in the pasted list. To prepare unique values, use the Duplicate remover.

Are pasted database identifiers stored on a server?

No. The tool runs locally in your browser and does not send list contents to a server or external APIs.

What is the maximum number of items I can format at once?

The tool does not impose a fixed limit. The practical list size depends on your browser's and device's memory and performance.

Use the tool ↑