The MIME type for a PDF is application/pdf, for CSV it is text/csv, for JSON application/json, for plain text text/plain and for HTML text/html. Word .docx files use application/vnd.openxmlformats-officedocument.wordprocessingml.document and Excel .xlsx files use application/vnd.openxmlformats-officedocument.spreadsheetml.sheet. Every type below was checked against the IANA media types registry and the MDN common types list on 23 November 2026.
Documents and data files
| File | Ending | MIME type | IANA reference |
|---|---|---|---|
| application/pdf | RFC 8118 | ||
| JSON | .json | application/json | RFC 8259 |
| JSON-LD | .jsonld | application/ld+json | W3C |
| CSV | .csv | text/csv | RFC 4180, RFC 7111 |
| Plain text | .txt | text/plain | RFC 2046, RFC 3676, RFC 5147 |
| HTML | .html, .htm | text/html | W3C |
| Markdown | .md | text/markdown | RFC 7763 |
| XML | .xml | application/xml (text/xml also registered) | RFC 7303 |
| YAML | Not listed by MDN | application/yaml | RFC 9512 |
| Rich Text | .rtf | application/rtf | IANA registration |
| Calendar (iCalendar) | .ics | text/calendar | RFC 5545 |
| Tab separated values | Not listed by MDN | text/tab-separated-values | IANA registration |
| EPUB e-book | .epub | application/epub+zip | W3C EPUB 3 WG |
MDN has no row for YAML or tab separated files, so no ending is given for them here; their MIME types are taken from the IANA registry, which lists the type name and its defining document.
Microsoft Office and OpenDocument
| File | Ending | MIME type |
|---|---|---|
| Word (modern) | .docx | application/vnd.openxmlformats-officedocument.wordprocessingml.document |
| Word 97 to 2003 | .doc | application/msword |
| Excel (modern) | .xlsx | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet |
| Excel 97 to 2003 | .xls | application/vnd.ms-excel |
| PowerPoint (modern) | .pptx | application/vnd.openxmlformats-officedocument.presentationml.presentation |
| PowerPoint 97 to 2003 | .ppt | application/vnd.ms-powerpoint |
| OpenDocument text | .odt | application/vnd.oasis.opendocument.text |
| OpenDocument spreadsheet | .ods | application/vnd.oasis.opendocument.spreadsheet |
| OpenDocument presentation | .odp | application/vnd.oasis.opendocument.presentation |
All nine are registered with IANA. The long Office names are easy to mistype, so copy them exactly; a single wrong letter means the server or form will not recognise the file.
Archives and unknown files
| File | Ending | MIME type | Notes from MDN |
|---|---|---|---|
| ZIP | .zip | application/zip | Windows uploads .zip files as application/x-zip-compressed, which is not standard |
| Gzip | .gz | application/gzip | Windows and macOS upload .gz files as application/x-gzip, which is not standard |
| RAR | .rar | application/vnd.rar | Registered with IANA |
| 7-Zip | .7z | application/x-7z-compressed | Listed by MDN, not registered with IANA |
| Any unknown binary file | .bin and others | application/octet-stream | The default for binary data; browsers usually download it |
Rules worth knowing
- Type and subtype. MDN describes a MIME type as a type and a subtype separated by a slash with no spaces, such as application/pdf, optionally followed by a parameter.
- Case. MIME types are case-insensitive but are normally written in lower case.
- Text encoding. Types under text can carry a charset parameter. For a UTF-8 text file MDN gives text/plain;charset=UTF-8; without it the default is US-ASCII unless the browser overrides it.
- Defaults. MDN says text/plain is the default for readable text files and application/octet-stream for everything else.
- XML. MDN notes that application/xml is recommended under RFC 7303, although text/xml is still seen.
- JavaScript. Use text/javascript. IANA marks application/javascript as obsoleted in its favour (RFC 9239).
Using these types in an upload form
To let people choose only PDF and Word files, a file input can list both the MIME types and the endings:
<input type="file" accept="application/pdf,.pdf,application/vnd.openxmlformats-officedocument.wordprocessingml.document,.docx">
Including the endings helps when a device reports a non-standard type, such as the Windows ZIP type above. The file picker filter is only a convenience, so a server should still check each upload. For image formats, see our image MIME types list.
Sources and dates
| Page | Checked | Used for |
|---|---|---|
| IANA media types registry (application and text CSV exports) | 23 November 2026 | Which types are registered, references, obsoleted application/javascript |
| MDN: common media types | 23 November 2026 | File endings, ZIP and Gzip upload notes, 7-Zip type, defaults, XML note |
| MDN: media types | 23 November 2026 | Structure, case, charset, browsers using the type rather than the ending |
Frequently asked questions
What is the MIME type for PDF?
application/pdf, registered with IANA through RFC 8118. The file ending is .pdf.
What is the MIME type for CSV?
text/csv, registered with IANA through RFC 4180 and RFC 7111. Add charset=UTF-8 if the file contains characters outside plain ASCII.
What is the MIME type for JSON?
application/json, registered with IANA through RFC 8259. JSON-LD files use application/ld+json.
What is the MIME type for a DOCX file?
application/vnd.openxmlformats-officedocument.wordprocessingml.document. Older .doc files use application/msword.
What MIME type should I use for an unknown file?
application/octet-stream. MDN calls it the default for binary data, and browsers usually download such files rather than open them.