LTLine Toolkit

Tools / Guide

When CSV Needs Quotes Around a Value

A comma inside a value is the most common cause of a broken CSV import. Here are the rules, and the tools that fix it in seconds.

CSV looks like the simplest format in computing and it is the one that breaks most often. The reason is almost always the same: a value that contains the separator, and a file that did not quote it.

The rule in one sentence

A field must be wrapped in double quotes if it contains a comma, a double quote, a line break, or leading or trailing whitespace that matters. Inside a quoted field, a literal double quote is written twice. Everything else can stay unquoted.

Why your import gained a column

Take a row like this:

1,Smith, John,Kathmandu, Nepal,40

That looks like six values to a human and eight to a parser. The address split into two fields, the name split into two, and every subsequent column shifted right. Nothing errored; the data is simply wrong, and it is usually discovered weeks later. The correct row quotes the fields that contain commas:

1,"Smith, John","Kathmandu, Nepal",40

Fixing a file without opening Excel

If you have a single line and need to see the real items, paste it into comma-separated list to lines. It is quote-aware, so "Smith, John" stays one item and the split tells you whether the file was correctly quoted in the first place: a value that splits in the middle is evidence that the quotes are missing upstream.

If you have a column and need to build a quoted, comma-separated line, the reverse direction uses add quotes around each line followed by convert newlines to commas.

Four details that catch people out

Tools used in this guide

Last verified: 2026-12-04