SHOPIFY CSV ENCODING ERROR

How to fix “Illegal quoting on line” in a Shopify CSV

This error usually means the CSV parser encountered a quotation mark or character sequence that broke the row structure. The problem is often introduced by spreadsheet exports, copied product descriptions, or smart quotes.

Quick answer

Work on a copy. Save the file as UTF-8 CSV, replace curly smart quotes with straight quotes where appropriate, and inspect the reported line for an unmatched or extra quotation mark. Do not delete every quote: commas, line breaks, and quotation marks inside fields must be escaped correctly.

Why Shopify reports illegal quoting

A CSV uses quotation marks to keep commas and line breaks inside one field. If a field begins with a quote but never closes, contains an unescaped quote, or is exported with incompatible encoding, Shopify can no longer tell where one column ends and the next begins.

Fix it step by step

1. Make a backup copy

Never experiment on the only copy of a product catalog. Duplicate the file first, especially when an import could overwrite products with matching handles.

2. Re-export as UTF-8 CSV

Use your spreadsheet application's CSV UTF-8 option. Renaming an Excel workbook from .xlsx to .csv does not convert the file.

3. Inspect the reported line

Open the CSV in a plain-text editor and go to the line Shopify reported. Look for one extra quote, a quote that never closes, or a copied description containing smart punctuation.

4. Preserve valid CSV escaping

When a quoted field itself contains a straight quotation mark, CSV represents it with two consecutive quotation marks.

"A 12"" shelf, black"

The doubled quote above represents one quotation mark inside the field. Removing structural quotes blindly can shift every later column.

5. Check multiline descriptions

HTML descriptions can contain commas and line breaks. They must remain inside one properly quoted field. A single pasted line break outside the quotes can create a misleading error farther down the file.

6. Validate the repaired file

Run the copy through VariantSafe. It can catch structural parsing failures and common row-level problems before you attempt another Shopify import.

Common causes

Check the repaired CSV before importing

VariantSafe reads the file locally in your browser and reports exact rows, columns, and safe automatic fixes.

Open the free CSV validator

Related Shopify CSV guides

Official Shopify references