“Illegal quoting on line”: how to fix this Shopify CSV error
Shopify could not read your CSV because a quotation mark on the reported line is in a place the CSV format doesn’t allow. It is almost always a curly quote, an inch mark such as 12", or a file saved in the wrong encoding.
Illegal quoting on line 2What the message means
In a CSV file, double quotes have a job: they wrap a value that contains a comma, a line break or another quote. A quote anywhere else breaks the parser, and Shopify stops at the first line where that happens. Merchants see the message with different line numbers, and older imports showed it as “Illegal quoting in line 2”. The number is the line in the file where parsing failed, counting the header as line 1.
Shopify lists this error with two causes: an illegal character or encoding problem, and smart (curly) quotes instead of straight quotes.
The usual causes
- Curly quotes such as “ ” or ‘ ’ pasted from Word, a website or a supplier PDF.
- Inch or seconds marks inside a value, such as
Frame 12" x 16", in a field that isn’t wrapped in quotes. - A quote that isn’t doubled. Inside a quoted field, a literal quote must be written twice:
"Frame 12"" x 16""". - A file that isn’t UTF-8. Files exported from older tools, or saved as a plain “CSV (Comma delimited)” in Excel, can contain characters Shopify can’t decode.
This breaks the import:
Title,URL handle,Price
Oak Frame 12" x 16",oak-frame-12x16,24.00This imports correctly, because the value is quoted and its inner quotes are doubled:
Title,URL handle,Price
"Oak Frame 12"" x 16""",oak-frame-12x16,24.00How to fix it
- Open the CSV in a plain-text editor (Notepad, TextEdit in plain-text mode, VS Code) rather than Excel, so you see the quotes exactly as Shopify does.
- Go to the line number in the message. Look for curly quotes, inch marks and quotes in the middle of a value.
- Replace curly quotes with straight ones, or remove them. For measurements you can also write
in:Frame 12 in x 16 in. - If a value must contain a double quote, wrap the whole value in double quotes and double the inner ones.
- Save as UTF-8. In Excel choose File → Save As and pick CSV UTF-8 (Comma delimited) (*.csv). In Google Sheets use File → Download → Comma-separated values. In Numbers use File → Export To → CSV with Unicode (UTF-8) encoding.
- Import again. If Shopify now reports a later line number, the first problem is fixed and the next one is further down.
Prevent it next time
Let a spreadsheet program or script write the CSV instead of assembling it by hand: they quote values that need it automatically. Keep measurements in separate columns (for example Width and Height) instead of typing inch marks into titles, and always save as CSV UTF-8.
Files exported by Sheet2Store are written by a CSV library that quotes every value that needs it and are saved as UTF-8, so titles copied from supplier PDFs with inch marks come through intact.
Frequently asked questions
Why does Shopify say line 2 when my file looks fine?
Line 2 is the first product row. Excel hides the quotes it adds or leaves out, so open the file in a text editor to see the real characters.
Is “Illegal quoting” the same as “Missing or stray quote”?
They are closely related. Both mean the quotes in a line don’t follow CSV rules. “Missing or stray quote” usually points to an unclosed quoted value, often from an inch mark.
Can I just delete all quotes from the file?
Only from values that don’t need them. A value containing a comma or line break must stay wrapped in quotes, or the columns will shift.
Turn a supplier file into an import-ready CSV
Upload a supplier PDF, Excel or CSV price list. Map the columns, set your markup, fix flagged rows and download a Shopify or WooCommerce CSV. The first five rows are free to preview.