Skip to content
Private: files never leave your device

Document MIME Types: PDF, CSV, JSON, Office and More

Upload forms, web servers, email and APIs all label files with a MIME type, also called a media type or content type. This list gives the correct type for the documents, data files and archives people handle every day, checked against the IANA registry and the MDN list of common types.

Document MIME types from IANA and MDN: application/pdf for PDF, text/csv for CSV, application/json for JSON and application/octet-stream for unknown binary files

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

FileEndingMIME typeIANA reference
PDF.pdfapplication/pdfRFC 8118
JSON.jsonapplication/jsonRFC 8259
JSON-LD.jsonldapplication/ld+jsonW3C
CSV.csvtext/csvRFC 4180, RFC 7111
Plain text.txttext/plainRFC 2046, RFC 3676, RFC 5147
HTML.html, .htmtext/htmlW3C
Markdown.mdtext/markdownRFC 7763
XML.xmlapplication/xml (text/xml also registered)RFC 7303
YAMLNot listed by MDNapplication/yamlRFC 9512
Rich Text.rtfapplication/rtfIANA registration
Calendar (iCalendar).icstext/calendarRFC 5545
Tab separated valuesNot listed by MDNtext/tab-separated-valuesIANA registration
EPUB e-book.epubapplication/epub+zipW3C 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

FileEndingMIME type
Word (modern).docxapplication/vnd.openxmlformats-officedocument.wordprocessingml.document
Word 97 to 2003.docapplication/msword
Excel (modern).xlsxapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Excel 97 to 2003.xlsapplication/vnd.ms-excel
PowerPoint (modern).pptxapplication/vnd.openxmlformats-officedocument.presentationml.presentation
PowerPoint 97 to 2003.pptapplication/vnd.ms-powerpoint
OpenDocument text.odtapplication/vnd.oasis.opendocument.text
OpenDocument spreadsheet.odsapplication/vnd.oasis.opendocument.spreadsheet
OpenDocument presentation.odpapplication/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

FileEndingMIME typeNotes from MDN
ZIP.zipapplication/zipWindows uploads .zip files as application/x-zip-compressed, which is not standard
Gzip.gzapplication/gzipWindows and macOS upload .gz files as application/x-gzip, which is not standard
RAR.rarapplication/vnd.rarRegistered with IANA
7-Zip.7zapplication/x-7z-compressedListed by MDN, not registered with IANA
Any unknown binary file.bin and othersapplication/octet-streamThe 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).
Why does a site reject my file? MDN warns that browsers use the MIME type, not the file ending, to decide how to handle a file. Renaming a file does not change what is inside it, so convert it instead, for example with Word to PDF, Excel to PDF or JSON to CSV.

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

PageCheckedUsed for
IANA media types registry (application and text CSV exports)23 November 2026Which types are registered, references, obsoleted application/javascript
MDN: common media types23 November 2026File endings, ZIP and Gzip upload notes, 7-Zip type, defaults, XML note
MDN: media types23 November 2026Structure, 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.