CSV MIME Type
text/csv files contain, how CSV quoting and headers work, and how Poly previews, searches, and reads them. MIME type details for text/csv
In active use| MIME type | text/csv |
|---|---|
| Extensions | .csv |
| First standardized | 2005 |
| Created by | Yakov Shafranovich |
| Browser support | Chrome, Edge, Firefox, Opera, Safari |
| Example applications | Microsoft Excel, Apple Numbers |
| Poly support | Yes. Poly recognizes `.csv` files and makes their readable text available without changing the original data. |
| Indexed by Poly | Yes. Poly indexes CSV filenames and readable text for full-text and semantic search. |
| Preview in Poly | Yes. CSV files open in Poly's text editor with syntax highlighting, word wrap, and in-file search. |
| Poly agent | Yes. The Poly agent can read and reason about the CSV's text, including rows, headers, and values. |
What does text/csv mean?
The text/csv media type identifies comma-separated values: plain-text records arranged as rows and fields. It is commonly used to exchange one table between spreadsheets, databases, analytics tools, and applications. IANA registers .csv as the file extension and lists no magic number, so a filename or HTTP Content-Type often supplies the strongest initial clue.1
CSV is a data-exchange format, not a spreadsheet workbook. It has no standard way to store formulas as calculations, cell formatting, charts, multiple sheets, data types, or relationships between tables. A field that looks like a date or number is still text until the importing application interprets it.
text/csv has two optional media-type parameters. charset identifies the character encoding, and header=present or header=absent says whether the first row contains column names. When charset is omitted, the current IANA registration says UTF-8 should be assumed.1How is a CSV file structured?
RFC 4180 documented a widely used CSV shape and registered text/csv in October 2005. It is an Informational RFC rather than a universal master specification, which matters because real exporters differ in delimiters, line endings, quoting, and character encoding.2
In the RFC 4180 form:
- Each record occupies a line, normally separated with CRLF.
- A first row may contain column names.
- Commas separate fields, and records should have the same number of fields.
- A field containing a comma, double quote, or line break is enclosed in double quotes.
- A double quote inside a quoted field is written twice.
For example:
name,city,note
Ada,"London, UK","Said ""hello"""
Lin,Seattle,"Line one
Line two"
That last record is still one CSV row even though its quoted final field contains a line break. A line-oriented text tool that ignores quoting may split it incorrectly.
How do you open a text/csv file?
Microsoft Excel, Apple Numbers, LibreOffice Calc, database tools, and many programming-language libraries can import CSV. Excel opens .csv directly, but its default regional and data-format settings can affect delimiter choice, dates, and leading zeros. Microsoft recommends using its text import workflow when you need explicit control over column interpretation.3 Numbers can import delimited text and lets you adjust the delimiter, text qualifier, and encoding.4
Current Chrome, Edge, Firefox, Opera, and Safari can retrieve text/csv resources. What happens after navigation depends on the response headers and browser settings: the file may appear as text, download, or open in an associated application. Browsers do not promise a spreadsheet-style grid merely because the server sends text/csv. Web servers should send the registered media type instead of relying on the .csv suffix alone.5
Support in Poly
Poly recognizes the text/csv media type and .csv filenames. It previews the original readable content in the text editor with CSV syntax highlighting, word wrap, and in-file search. CSV text and ordinary file details are indexed, so you can find an exact value or use a natural-language search to locate a relevant dataset.
The Poly agent can read the rows, headers, and values and help summarize or reason about them. Poly presents CSV as text rather than as a spreadsheet grid, so it does not assign durable column types, calculate formulas, or reproduce workbook formatting.
Why does the same CSV import differently elsewhere?
CSV implementations have long differed, and the IANA registration explicitly calls out those interoperability differences.1 Common trouble spots include:
- Delimiter: despite the name, some regional spreadsheet settings produce semicolon-separated files.
- Encoding: UTF-8 is the safest default for new interchange, but older exports may use a legacy encoding or add a byte-order mark.
- Headers: without the
headerparameter or outside documentation, software may have to guess whether the first row contains names. - Automatic typing: spreadsheet software may turn identifiers into numbers, strip leading zeros, or reinterpret dates.
- Line endings and quoting: robust importers often accept more than RFC 4180 describes, but not all accept the same variations.
When accuracy matters, specify the delimiter and encoding, preserve identifiers as text, and validate row widths after import. A small schema or data dictionary can document column meanings and types that CSV itself cannot express.
CSV compared with TSV, JSON, and spreadsheets
| Format | Best suited to | What it preserves |
|---|---|---|
CSV (text/csv) | One broadly exchangeable table | Rows and text fields |
TSV (text/tab-separated-values) | Tables whose fields commonly contain commas | Rows and tab-delimited text fields |
| JSON | Nested or typed application data | Arrays, objects, numbers, strings, booleans, and nulls |
| XLSX | Editable spreadsheet workflows | Multiple sheets, formulas, formatting, charts, and richer cell metadata |
Microsoft notes that saving a workbook as CSV preserves only the active sheet and removes formatting and unsupported workbook features.6 Export each required sheet separately, keep the workbook as the source when its structure matters, and inspect the exported CSV before distributing it.
RFC 7111 adds a fragment syntax for referring to selected CSV rows, columns, or cells in a URI. Support is client-dependent, so a link with a CSV fragment may still open the whole file in software that does not implement the RFC.7
Security and privacy considerations
CSV is passive text, but the software that opens it may apply active spreadsheet behavior. OWASP warns that values beginning with formula-triggering characters can be interpreted as formulas when an exported file is opened in a spreadsheet application. Treat CSV containing untrusted input carefully, and test any sanitization with the exact applications that will consume it.8
CSV also provides no built-in encryption, integrity check, access control, or reliable place for sensitivity labels. Review exports for hidden identifiers and personal data, and protect the file in transit and at rest when its contents are sensitive.1
Footnotes
- Internet Assigned Numbers Authority. text/csv Media Type Registration. ↩ ↩2 ↩3 ↩4
- Shafranovich, Y. RFC 4180: Common Format and MIME Type for Comma-Separated Values (CSV) Files. Internet Engineering Task Force, October 2005. ↩
- Microsoft Support. Import or Export Text (.txt or .csv) Files. ↩
- Apple Support. Import an Excel or Text File into Numbers on Mac. ↩
- MDN Web Docs. Media Types (MIME Types). ↩
- Microsoft Support. Save a Workbook to Text Format (.txt or .csv). ↩
- Hausenblas, M., Wilde, E., and Tennison, J. RFC 7111: URI Fragment Identifiers for the text/csv Media Type. January 2014. ↩
- OWASP Foundation. CSV Injection. ↩