Updated 2026-10-18
Why Is My CSV File Not Uploading? 8 Causes and Fixes
A CSV upload is refused for one of eight reasons, and only two of them are about the data. The rest are about how the file is named, how big it is, and which bytes sit at the start of the first line. Check them in the order below and you will usually find the answer in under a minute.
Quick answer
If the site rejects the file before it shows any rows, the problem is the container: extension, MIME type or size. If it accepts the file and then reports empty columns, a bad header, or the wrong number of fields, the problem is the content: encoding, delimiter, quoting or row shape. That split is the whole diagnosis. A 413 or a file type error is never fixed by editing values inside the file, and a column error is never fixed by renaming it.
1. The extension is not what it looks like
Windows hides known file extensions by default. A file exported as data.csv.txt shows up in Explorer as "data.csv" with a text file icon, and every uploader that checks the last segment of the name sees .txt. Turn on file name extensions in Explorer view settings before anything else. On macOS the equivalent check is Get Info, and the terminal command file answers the same question on every platform.
The other version of this problem is a spreadsheet file with a CSV name. Renaming data.xlsx to data.csv does not convert anything: the bytes are still a zip archive, and the importer will fail while reading the first record. Use Save As and pick CSV, which is covered in converting between CSV and Excel formats.
2. The MIME type does not match what the server expects
The CSV media type is text/csv, registered in section 3 of RFC 4180. The browser does not read the file to decide that. It looks up the extension in the operating system table and sends the result in the Content-Type header of the upload request. On Windows, where Excel claims the .csv extension, that lookup can return an Excel type such as application/vnd.ms-excel rather than text/csv.
A server that compares the header to text/csv exactly will then reject a perfectly valid file. You cannot fix this from your side of the form, but you can confirm it: if the same file uploads from another browser or another machine, the content was never the issue. The workaround that usually works is to upload the same bytes with a .txt name (when the site accepts text files) or inside a zip, and then report the type check to the site. This is also why a site that accepts CSV should check the parsed content rather than the header alone.
3. The file is over the server size cap
The CSV format has no size limit. Every limit you meet belongs to the site, the web server, or the proxy in front of it. When the request body is larger than the server accepts, the HTTP response is 413, called Content Too Large in RFC 9110, and many sites surface it as a generic "upload failed" message with no detail.
A 413 is a size answer. Compressing the file, splitting it, or reducing the number of columns will help; editing values will not. Split by rows rather than by bytes when the file is going to be reassembled, because a byte split can land in the middle of a quoted field and produce two files that neither parse nor join cleanly. The CSV splitter cuts on record boundaries, and splitting a large CSV covers the cases where splitting is the wrong answer.
4. The encoding is not what the importer assumes
Two failures live here, and they look different. The first is a file the reader cannot decode at all: a UTF-16 export read as UTF-8 stops immediately with an error about an invalid start byte. The second is a file that decodes fine but carries three extra bytes at the front, the UTF-8 byte order mark (EF BB BF), which a non-BOM-aware reader keeps as part of the first field.
We measured both on 2026-10-18 with Python 3.13.5. Reading a BOM-prefixed file as utf-8 gave a first header of \ufeffid, and looking up id failed; the same file read as utf-8-sig gave id. Reading a UTF-16 file as utf-8 raised UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte. The file was correct in both cases, and the reader had the wrong idea about it.
The fix is to save without a BOM when the importer asks for plain UTF-8, and to keep the BOM when it asks for Excel compatibility. Both are a menu choice in a text editor rather than a change to the data, and the trade-off is described in CSV file encoding.
5. The delimiter is not the one the importer expects
This is the most common "it uploaded but nothing is there" case. The upload succeeds because the file is a valid text file; the import then produces one column containing everything, or an error saying no columns were found. A semicolon file parsed with a comma delimiter does exactly that, silently.
In our 2026-10-18 check, one semicolon-separated file read with a comma delimiter returned three rows of one field each; read with a semicolon it returned three rows of three fields. Same bytes, two different files as far as the importer is concerned. This is not a corruption, and it is common in locales where the comma is the decimal separator, because the export has to use something else. Convert it with the delimiter converter or change the setting in the importer. The four common delimiters are compared in CSV delimiter options.
6. A field contains an unquoted comma, quote or line break
RFC 4180 allows a field to contain a comma only when the whole field is wrapped in double quotes, and it requires an inner double quote to be written twice. An export that skips that rule produces a file which looks fine in a text editor and falls apart in a parser.
The symptom is a row with too many fields, or a record that appears to restart in the middle of a sentence. Because a quoted line break is legal, a single record can legitimately span several visual lines, so the row count in an editor is not the record count. The rules are set out in quotes in CSV files, and the column symptom is the same one described in a CSV opening in one column.
7. Blank rows, trailing commas and empty header cells
An importer that validates shape treats a trailing blank line as a record with one empty field, and treats a trailing comma as an extra column. Both are invisible in a spreadsheet, which ignores them, and fatal in a strict parser, which does not. The same applies to a header row with an empty cell: the importer has to give that column a name, and many refuse instead.
Strip the blank rows before uploading. The blank row removal walkthrough covers the cases where a row looks blank but is not, and the CSV cleaner does the pass without a spreadsheet adding its own interpretation.
8. A value trips a security filter
Some uploaders reject or sanitise fields that begin with =, +, - or @, because spreadsheets treat those as the start of a formula. This is the CSV injection defence, and it fires on data that is legitimate: a negative amount written as -12.50 in a text field, a product code starting with a plus sign, a note beginning with an equals sign. The rejection message is usually vague, which is why this cause is easy to miss.
If every other check passes, look for a field whose first character is one of those four. Changing the value is not always acceptable, so the practical options are a leading apostrophe (if the importer strips it) or reporting the case, because a well-built importer should sanitise rather than reject.
The diagnostic order that saves the most time
| Symptom | Check first | Fix |
|---|---|---|
| Rejected instantly, no rows shown | the real extension, then the file size | rename, or split the file |
| "Invalid file type" | Content-Type sent by the browser | try another browser, report the check |
| Upload works, columns empty | the delimiter | convert the delimiter |
| Header missing its first column name | the first three bytes for a BOM | save as UTF-8 without BOM |
| Garbled accented characters | the encoding the file was exported in | re-export as UTF-8 |
| Wrong number of columns | field count per record against the header | fix quoting, remove blank rows |
One more limit worth knowing before you conclude the file is corrupt: spreadsheets have their own ceilings, so a file can be valid and still not fit. Excel accepts 1,048,576 rows by 16,384 columns per worksheet, per Microsoft's published specifications. A CSV larger than that opens partially or not at all, which is covered in Excel row limits. The format itself is fine with the extra rows.
What to do when you own the uploader
If you are on the other side of this problem, three changes remove most false rejections. Accept the file by extension and by parsed content instead of by MIME type alone, since the browser is an unreliable narrator of what a .csv is. Read the first bytes and strip a BOM before parsing, which costs nothing and fixes the most confusing header bug. Report the specific reason for a rejection, row number and column name included, so the person uploading can act instead of guessing.
Frequently asked questions
Why does a site say my CSV file is an invalid file type?
The uploader is checking either the extension or the MIME type the browser sent, and one of them does not match what it expects. The CSV media type is text/csv, registered in section 3 of RFC 4180. Browsers derive the type from the file extension using the operating system table, so a .csv that Windows associates with Excel can be sent as application/vnd.ms-excel, and a server that compares the header to text/csv exactly will reject it. Renaming the file to .txt or zipping it usually gets past a bad type check, which tells you the content was never the problem.
Is there a size limit for CSV uploads?
There is no limit in the format. Any cap you meet belongs to the site, the web server or the proxy in front of it. When a request body is larger than the server accepts, the response is HTTP 413, called Content Too Large in RFC 9110. A 413 is a size answer, not a format answer, so editing the content will not help; the file has to be split or compressed. Splitting by rows keeps every record intact, and splitting by bytes can cut a quoted field in half.
Can a byte order mark stop a CSV from uploading?
Yes, when the importer reads the file as plain UTF-8 and checks the first header name. The BOM is three bytes at the start of the file, and a UTF-8 reader that does not strip them keeps them as part of the first field. We measured this on 2026-10-18 with Python 3.13.5: reading a BOM-prefixed file as utf-8 gave a first header of id and a lookup for id failed, while reading the same file as utf-8-sig gave id. Saving the file without a BOM, or having the importer use a BOM-aware reader, fixes it without touching the data.
Why does the upload succeed but the columns are empty?
That is a delimiter mismatch rather than a failed upload. The file was accepted, then parsed with the wrong separator, so every record became a single field. In our 2026-10-18 check, a semicolon-separated file parsed with a comma delimiter produced one field per row on all three lines, and the same bytes parsed with a semicolon produced three fields per row. Semicolon files are common in locales that use the comma as a decimal separator. Convert the delimiter before uploading, or pick the right one in the importer.
Why is my CSV rejected for having the wrong number of columns?
Because some row has a different field count from the header. The usual causes are an unquoted comma inside a value, a quoted field that lost its closing quote and swallowed the rest of the line, a trailing comma at the end of a record, or a blank line at the end of the file. RFC 4180 says every record should contain the same number of fields, so an importer that validates the shape will stop at the first row that does not. Find the row by comparing field counts, not by reading the file.
Does the file extension matter if the content is CSV?
To the format, no. To the uploader, often yes. Many sites accept only a list of extensions, so a correct CSV named data.txt or data.xls is refused before anything reads it. Windows also hides known extensions by default, which is how a file saved as data.csv.txt ends up looking like data.csv in Explorer. Turn on file name extensions in Explorer before you debug anything else, because a double extension looks exactly like a correct one.
Why does my CSV upload fail only in one browser?
Because the browser is the layer that decides the Content-Type header, and browsers on different operating systems do not always agree on what a .csv is. The same file can arrive as text/csv in one browser and as an Excel type in another, especially on Windows where Excel claims the extension. If a file uploads from one machine and not another, compare the request headers rather than the file, and report the type to the site so the check can be widened.
How do I test a CSV before uploading it again?
Check four things in order: the extension as the operating system sees it, the file size against the site limit, the encoding at the first bytes, and the field count per record against the header. The CSV analyzer does the last two in one pass and reports the field count per row and the width of each column, so a mismatch or a BOM shows up as a number before the upload does.
Sources
- IETF, RFC 4180: Common Format and MIME Type for CSV Files, section 2 (fields, quoting, equal field count) and section 3 (registration of text/csv).
- IETF, RFC 9110: HTTP Semantics, section 15.5.14 (413 Content Too Large).
- Microsoft Support, Excel specifications and limits (1,048,576 rows by 16,384 columns per worksheet).
- Our own measurement, 2026-10-18, Python 3.13.5: BOM-prefixed file read as utf-8 gives a first header of \ufeffid and a failed lookup for id, utf-8-sig gives id; UTF-16 read as utf-8 raises UnicodeDecodeError on byte 0xff; a semicolon file parsed with a comma delimiter yields one field per row.
Related reading
Check the file before the next upload
The CSV analyzer reports the header, the field count per record and the width of each column, which is enough to catch a BOM, a delimiter mismatch or a broken record before a server does. If the file needs cleaning rather than diagnosis, run it through the CSV cleaner and compare the result with the original.
Related reading
Data Cleaning — other guides that pair well with this one.
- Remove Blank Rows from CSV
- Fix Garbled CSV in Excel
- Convert CSV to Excel Without Excel
- Convert Excel to CSV Free Online
Browse all guides in the NoCodeCSV blog.