Turn an Excel column into a SQL IN list

Add quotes and commas to a column of IDs while preserving leading zeros and escaping apostrophes.

Processed on your device

Input

Open a local UTF-8 text file5 MiB maximum. The file opens in the text box above.Or drop a file here.

Options

Options
Choose how your existing values are separated. Use lines for a pasted spreadsheet column.
SQL adds quotes and parentheses; JSON creates an array of text values. Custom uses the options below.

Create the list

Copy the cells in one spreadsheet column and paste them above. The SQL preset puts each value inside single quotes, separates the values with commas and adds outer parentheses. Copy the result into the appropriate part of your query.

Keep identifiers as text

A code such as 00123 is different from 123. This tool keeps the pasted characters, including leading zeros. If the spreadsheet already changed the code to 123, the missing zeros cannot be recovered without another source.

Handle apostrophes

An apostrophe inside a SQL string literal is doubled. The sample value O'Brien becomes O''Brien inside its surrounding quotes. The tool performs this escaping for every value.

Check the result

The preset removes blank values and trims outer spaces. Change those settings when spaces are meaningful. Review the item count and keep your original column. For application queries, continue to use your database library's parameter support.

Reviewed 2026-09-13. Open Delimiter converter with all settings.