The Official CSV MIME Type
RFC 4180 registers text/csv as the media type for comma-separated values. That is what APIs and browsers should advertise when serving CSV downloads or accepting CSV uploads.
Content-Type: text/csv; charset=utf-8
Content-Disposition: attachment; filename="orders.csv"Why charset Matters
text/csv does not magically know your encoding. Add charset=utf-8 so clients decode non-ASCII text correctly. Omitting charset invites locale-dependent guesses—and mojibake.
Related Headers for Downloads
MIME type alone does not force a download filename.
| Header | Purpose |
|---|---|
| Content-Type: text/csv; charset=utf-8 | Declare CSV + encoding |
| Content-Disposition: attachment; filename=... | Suggest download name |
| Content-Length | Size (helpful for progress) |
| Cache-Control | Avoid stale exports if data changes often |
Step-by-Step: Serve CSV from an API
A minimal Node example.
res.setHeader("Content-Type", "text/csv; charset=utf-8");
res.setHeader(
"Content-Disposition",
"attachment; filename=\"orders.csv\"",
);
res.send("\uFEFForder_id,email\n1001,ada@example.com\n");About the optional BOM
Prefacing UTF-8 CSV with a BOM can help Excel on Windows open the file correctly. Omit it for pure developer consumers if they do not expect it.
Uploads: What Servers Should Accept
Browsers may send text/csv, application/vnd.ms-excel, application/octet-stream, or even empty types for .csv files. Validate by content (header row, parse attempt)—not only by Content-Type.
Wrong MIME Types You Will See
Legacy and convenience types still appear in the wild.
- application/csv — non-standard; prefer text/csv.
- text/plain — works but loses intent for clients.
- application/vnd.ms-excel — sometimes used so Excel opens downloads; can confuse non-Excel clients.
- text/comma-separated-values — obsolete synonym territory; stick to text/csv.
Real-World Examples
MIME choices with consequences.
SaaS export button
Setting Content-Disposition fixed "random download names" users reported in Chrome.
Partner integration
A partner rejected uploads that were labeled application/octet-stream even though parseable; documenting accepted types unblocked them.
Excel-friendly export
UTF-8 BOM + text/csv fixed garbled European characters when users opened downloads in Excel.
Common Mistakes
Headers are easy to forget.
- Sending JSON Content-Type with CSV bodies.
- Omitting charset for non-ASCII CSV.
- Trusting upload MIME without parsing.
- Using filename*= incorrectly and breaking non-ASCII names.
- Caching personalized CSV exports publicly.
Best Practices
Keep responses boring and correct.
- Use text/csv; charset=utf-8.
- Set Content-Disposition for human downloads.
- Parse to validate uploads.
- Document BOM policy for Excel users.
- Test open-in-Excel and open-in-Sheets for customer-facing exports.
Why Use Convert CSV Online?
Convert CSV Online is free, browser-based, and requires no account for everyday conversions. When you need a correct file before wiring MIME headers, preview and convert locally, then plug the bytes into your API. Client-side workflows work on Windows, macOS, and Linux browsers.
Correct file, then correct headers
MIME cannot fix a broken delimiter—clean the CSV first.
Conclusion
The CSV MIME type is text/csv. Add charset=utf-8, set Content-Disposition for downloads, and validate uploads by parsing—not by trusting the browser’s Content-Type alone.
FAQ
What is the MIME type for CSV?
text/csv, registered in RFC 4180. Prefer Content-Type: text/csv; charset=utf-8.
Should I include charset=utf-8?
Yes whenever the file may contain non-ASCII characters. It tells clients how to decode the bytes.
Is application/csv valid?
It appears in the wild but is not the standard. Use text/csv.
How do I make the browser download CSV instead of displaying it?
Send Content-Disposition: attachment; filename="your.csv" along with text/csv.
Why does Excel still garble my CSV download?
Encoding issues—not MIME alone. Use UTF-8 and consider a BOM for Excel on Windows.
Can upload Content-Type be trusted?
No. Browsers send inconsistent types for .csv. Parse and validate the content.
References
Convert your CSV in the browser
Preview, clean, and convert CSV files free with Convert CSV Online—no installation and no account required for everyday conversions.