Skip to content
Column to Comma,
More free tools

Add single quotes around each item in a list

Paste one value per line. Each value gets single quotes and a comma, which is what SQL, Python and many config files expect.

Direction
Quick:
Options

Options

Your text never leaves your browser. Read how we handle data.

Example

This input:

apple
banana
cherry
O'Brien

gives this output with the settings on this page:

'apple', 'banana', 'cherry', 'O''Brien'

Quote each value in one step

Paste the column and the quoted list appears. For example, apple, banana and cherry become 'apple', 'banana', 'cherry'. You do not need a formula or a find and replace.

Spaces around each value are trimmed first, so a pasted cell like " apple " does not end up with spaces inside the quotes.

Apostrophes inside values

A single quote inside a value would break the list, so the tool doubles it. O'Brien becomes 'O''Brien'. This is the rule for SQL and for CSV. If you write Python and want a backslash instead, use the JSON array setting on the JSON array page.

Leave numbers bare

Tick Do not quote numbers if your column holds IDs and you want 1001 instead of '1001'. Values with leading zeros keep their quotes. If your column mixes numbers and text, the numbers stay bare and the text gets quotes.

Questions about this page

Can I use double quotes instead?

Yes. Open the Quotes menu and choose Double. For a CSV row, also set the separator to Comma without a space.

Can I put each quoted value on its own line?

Yes. Choose Custom in the Separator menu and type ,\n so each value ends with a comma and a line break. Choose New line to get quoted values with no commas.

What if a value already has quotes?

The tool adds a new pair around the whole value and doubles the quotes inside. Remove the old quotes first if you do not want that. List to column mode removes them.

More conversions

More free tools from Bingemind