ShopiClean
✓ 7-Day Pass Active Open CSV Auditor →
Syntax Error

How to Fix “Illegal quoting on line X” in a Shopify CSV Import

Last updated: 8 November 2026 • 6 min read

Short answer

Shopify’s help center says “Illegal quoting on line” is caused by an illegal character in the file, and that your CSV must be UTF-8 encoded. It can also be caused by a missing or stray quote. Open the file in a text editor at the reported line, look for a quote mark that is curly, unpaired, or inside an unquoted cell, fix it, save as UTF-8 and import again.

What Shopify says about these errors

Shopify’s “Solutions to common product CSV import problems” page lists two related messages:

  • Illegal quoting on line: caused by an illegal character in the CSV file. Shopify’s fix is to remember that your CSV file must be UTF-8 encoded, and it adds that sometimes the error is caused by a missing or stray quote.
  • Missing or stray quote on line: can be the result of Excel or another spreadsheet program adding curly (smart) quotes, which need to be replaced with straight quotes. Another possible cause is an extra quote that was added to the file; open the file in a text editor, find the line with the error, and remove stray quotes.

So there are three things to check, in this order: the encoding, curly quotes, and quotes that are unpaired or in the wrong place.

How quoting works in a CSV file

A cell that contains a comma, a line break or a double quote has to be wrapped in double quotes. A double quote inside such a cell is written twice. That is the whole rule, and every error in this guide is a breach of it.

Handle,Title,Body (HTML)
mug,Mug,"A 12"" ceramic mug, hand glazed"
mug-2,Mug 2,"A 12" ceramic mug, hand glazed"

The second data row is the broken one. The cell opens with a quote, the quote after 12 closes it too early, and the text that follows is no longer inside any quotes. The fix is to write 12"" (two quotes), or to avoid the character and write 12 inch or 12" in the HTML description.

If you only ever edit in a spreadsheet and export a CSV, the spreadsheet adds all of these quotes for you. Problems usually start when text is pasted into the CSV by hand, generated by a script, or edited in a text editor.

Find the line Shopify is complaining about

  1. Open the CSV in a text editor such as VS Code or Notepad++, not in Excel. A spreadsheet hides the quotes you need to see.
  2. Jump to the reported line (in VS Code press Ctrl+G and type the number).
  3. If your descriptions contain line breaks, one product can span several physical lines, so the number in the message may not match the row you see in a spreadsheet. Look at the area around that line rather than at one exact row.
  4. Read the quote marks on that line and the lines just above it. A cell that opens a quote and never closes it can make Shopify report the problem lower down than where it started.

Common causes and their fixes

CauseWhat it looks likeFix
The file is not UTF-8Accented letters or symbols look wrong in a text editorRe-open with the right encoding and save as UTF-8. See Troubleshooting UTF-8 encoding errors.
Curly (smart) quotes“ ” where a plain " should be, often added by Excel or a word processorReplace them with straight quotes, as Shopify suggests (search and replace in a text editor). If you want typographic quotes in a description, use the HTML entities “ and ”.
An inch mark or quote inside a quoted cell"A 12" ceramic mug"Double the inner quote (12""), or write 12 inch.
A quote inside an unquoted cellHe said "hi" with no quotes around the whole cellWrap the whole cell in quotes and double the inner ones.
A quote that opens and never closesEverything after it seems to belong to one huge cellAdd the missing closing quote, or remove the stray opening one.
A line break inside an unquoted cellOne product split over two linesWrap that cell in quotes.

Fix it step by step

  1. Keep a copy of the original file.
  2. Make sure the file is UTF-8 (see the encoding guide above), because Shopify names that as the first cause.
  3. Replace curly quotes with straight quotes, or switch to HTML entities in descriptions.
  4. Find each stray, doubled or unpaired quote on and above the reported line, and fix it using the rules above.
  5. Save as UTF-8 with LF line endings, which is what Shopify’s CSV guidance asks for.
  6. Import one or two products first with Overwrite products with matching handles turned off, then the full file.

One neighbouring problem is not this error but looks similar: an unquoted comma inside a description pushes the following cells one column to the right. Shopify may not call it an illegal quote, but your data lands in the wrong columns.

What ShopiClean does with quotes

Disclosure: ShopiClean is our own product. Everything in this guide can be done by hand in a spreadsheet; the tool simply automates the checks. The scan and the on-screen 5-row preview are free, and downloading the repaired file needs a 7-Day Pass ($9).

What it does:

  • Reads your CSV with a standard CSV parser and writes it back with every cell correctly quoted, so quoting problems it can interpret are repaired in the output.
  • Reports rows that have more cells than there are column headers, which is the usual sign of an unquoted comma, with the row numbers.
  • Converts a Windows-1252 file to UTF-8 and writes LF line endings.

What it does not do:

  • It does not replace curly quotes inside your text. If Shopify points at curly quotes, replace them yourself.
  • It cannot guess what you meant when a quote opens and never closes. The parser reads everything after it as part of one cell, so check the preview and the row count after scanning.
  • It does not repair the shifted data caused by an unquoted comma. It flags those rows so you can fix them in the source.

Sources and how this guide was checked

The Shopify behaviors described above were checked against the Shopify Help Center pages below on 8 November 2026. Shopify can change how imports work, so if something here differs from what you see, trust Shopify’s documentation.

Related guides