Illegal Quoting in Line 1
Why an import chokes on a quote mark, and how to fix the file.
The Short Answer
Illegal quoting in line 1 means the importer found a double quote mark (") somewhere the CSV rules don't allow it. Shopify shows this error, and so do many other sites that import CSV files.
Three things cause almost every case: an invisible marker at the start of the file, an inch mark inside a value, or a space before a quote. Rewriting the file with clean quoting fixes all three.
Fix the CSV in your browser →Where Quotes Are Allowed
In a CSV file, quotes can only wrap a whole value. That's how a value can contain a comma:
| In the file | Result |
|---|---|
shirt,"Large, blue" | OK: two values, shirt and Large, blue |
shirt,"Size 24"" frame" | OK: a quote inside a value is written twice |
shirt,Size 24" frame | Illegal quoting |
shirt, "Large, blue" | Illegal quoting (space before the quote) |
The wording comes from the CSV reader built into Ruby, the programming language Shopify is written in. We recreated every cause on this page with that reader to check it.
Cause 1: An Invisible Marker at the Start (Line 1)
When the error says line 1, the header row, the usual cause is a byte order mark (BOM). It's an invisible character some programs put at the start of a file to label it as UTF-8. Excel's "CSV UTF-8" format adds one, and so do many export tools.
A BOM on its own is usually harmless. But if the first column name is in quotes, the file starts with the BOM and then "Handle". The reader sees a quote in the middle of a value and stops. You can't see this in Excel or Notepad, which is why the header looks fine.
Cause 2: An Inch Mark or Stray Quote in a Value
Product titles and descriptions often contain " as an inch mark: 24" frame, 12" pizza pan. That's fine in a spreadsheet, but in the CSV file the value has to be wrapped in quotes with the inch mark doubled. A file written by hand, or by a careless export, leaves it bare and gets this error on that line.
Cause 3: A Space Before a Quote
A value like , "Large, blue", with a space after the comma, breaks the rule too. The quote no longer comes first, so it counts as part of the value. This usually comes from files typed or edited in a text editor, or produced by a script.
The Fix
- Open the CSV Fixer and choose your file. It reads quotes leniently, so a stray inch mark stays part of the value and a space before a quote is ignored.
- Check the preview. Each value should be in its own column, with inch marks where they belong.
- Untick Add a UTF-8 BOM. That option is for opening the file in Excel. For Shopify and other uploads, leave it off.
- Click Download CSV and import the new file.
The download rewrites every value with correct quoting and saves the file as UTF-8, which Shopify requires. The file is processed in your browser, so your product, customer or order data isn't uploaded anywhere.
Related Errors
- Any value after quoted field isn't allowed in line 2. Text follows a closing quote, like
"Big" shirt. It's a close relative of illegal quoting, from the same CSV reader. The CSV Fixer joins the pieces into one value, Big shirt. Check that's what you want. - Unclosed quoted field in line 2. A quote opens and never closes, so the rest of the file reads as one value. The CSV Fixer warns you about it, but nothing can guess where the quote should end. Open the file in a text editor, go to that line, and fix the quote by hand.
- Invalid byte sequence in UTF-8. The file isn't UTF-8, often because it came from an older Windows program. The CSV Fixer detects this and saves UTF-8.
- Missing or stray quote on line… is Shopify's own wording for the same kinds of quote problem.
Why Not Just Re-Save It in Excel?
Opening the file in Excel and saving it again often does clear the error, because Excel writes the quotes correctly. But Excel also changes your data on the way in. Barcodes and SKUs lose their leading zeros, numbers longer than 15 digits are rounded, and accented characters can turn into garbled text. If those columns matter, fix the file directly instead.
Frequently Asked Questions
What does "Illegal quoting in line 1" mean?
The importer found a double quote mark where the CSV rules don't allow one. Quotes may only wrap a whole value, directly after a comma or at the start of the line. Line 1 is the header row, so the problem is in the column names or right at the start of the file.
Why does it say line 1 when my header looks fine?
Usually because of an invisible character at the very start of the file, the UTF-8 byte order mark (BOM). If the first column name is in quotes, the BOM sits in front of the opening quote, and the importer reads that as a quote in the middle of a value. You can't see a BOM in Excel or most text editors.
How do I fix illegal quoting in a Shopify CSV?
Open the file in the Fair Toolbox CSV Fixer, check the preview, untick Add a UTF-8 BOM, and download the fixed CSV. It rewrites every value with correct quoting, removes the BOM and saves the file as UTF-8, which Shopify requires. Then import the new file.
Do curly quotes cause this error?
Not in our tests. We ran curly quotes through Ruby's CSV reader, the one Shopify's error wording comes from, and it accepted them as ordinary characters. The error is caused by straight double quotes (") in the wrong place.
Will re-saving the file in Excel fix it?
Often, because Excel writes the quotes correctly. But Excel also changes the data on the way: it strips leading zeros from barcodes and SKUs, and rounds long numbers. Fix the file without opening it in Excel if those columns matter.
What about "Unclosed quoted field"?
That means a value opens with a quote and never closes it, so the rest of the file looks like one long value. No tool can know where the quote should have ended. Open the file in a text editor, go to the line in the message, and add the missing quote or remove the stray one.