MIME Type Lookup — File Extension to MIME Type
Search 128+ MIME types by file extension (.pdf, .jpg, .mp4) or by MIME string (application/pdf, image/png). Each entry shows the full name, magic bytes, category, and a link to download a sample file from TrueFileSize.
Filter by category
128 of 128 MIME types
| Extension | MIME Type | Name | Magic Bytes | Sample |
|---|---|---|---|---|
application/pdf | PDF Document | %PDF- | Download | |
| .doc | application/msword | Microsoft Word (Legacy) | D0 CF 11 E0 | — |
| .docx | application/vnd.openxmlformats-officedocument.wordprocessingml.document | Microsoft Word | 50 4B 03 04 | Download |
| .xls | application/vnd.ms-excel | Microsoft Excel (Legacy) | D0 CF 11 E0 | — |
| .xlsx | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | Microsoft Excel | 50 4B 03 04 | Download |
| .ppt | application/vnd.ms-powerpoint | PowerPoint (Legacy) | D0 CF 11 E0 | — |
| .pptx | application/vnd.openxmlformats-officedocument.presentationml.presentation | Microsoft PowerPoint | 50 4B 03 04 | Download |
| .odt | application/vnd.oasis.opendocument.text | OpenDocument Text | 50 4B 03 04 | — |
| .ods | application/vnd.oasis.opendocument.spreadsheet | OpenDocument Spreadsheet | 50 4B 03 04 | — |
| .odp | application/vnd.oasis.opendocument.presentation | OpenDocument Presentation | 50 4B 03 04 | — |
| .rtf | application/rtf | Rich Text Format | {\rtf | — |
| .epub | application/epub+zip | EPUB Ebook | 50 4B 03 04 | Download |
| .tex | application/x-tex | LaTeX Document | — | — |
| .pages | application/vnd.apple.pages | Apple Pages | — | — |
| .numbers | application/vnd.apple.numbers | Apple Numbers | — | — |
| .keynote | application/vnd.apple.keynote | Apple Keynote | — | — |
| .txt | text/plain | Plain Text | — | Download |
| .csv | text/csv | CSV (Comma-Separated) | — | Download |
| .tsv | text/tab-separated-values | TSV (Tab-Separated) | — | — |
| .md | text/markdown | Markdown | — | Download |
| .json | application/json | JSON | — | Download |
| .jsonl | application/x-ndjson | JSON Lines (NDJSON) | — | — |
| .geojson | application/geo+json | GeoJSON | — | — |
| .xml | application/xml | XML | <?xml | Download |
| .yaml | text/yaml | YAML | — | Download |
| .yml | text/yaml | YAML (short ext) | — | Download |
| .toml | application/toml | TOML | — | Download |
| .ini | text/plain | INI Config | — | — |
| .env | text/plain | Environment Variables | — | — |
| .log | text/plain | Log File | — | Download |
| .sql | application/sql | SQL Script | — | Download |
| .sqlite | application/x-sqlite3 | SQLite Database | SQLite format 3 | Download |
| .db | application/x-sqlite3 | SQLite Database (.db) | — | Download |
| .parquet | application/vnd.apache.parquet | Apache Parquet | PAR1 | Download |
| .jpg | image/jpeg | JPEG Image | FF D8 FF | Download |
| .jpeg | image/jpeg | JPEG Image | FF D8 FF | Download |
| .png | image/png | PNG Image | 89 50 4E 47 | Download |
| .gif | image/gif | GIF Image | 47 49 46 38 | Download |
| .webp | image/webp | WebP Image | 52 49 46 46 | Download |
| .avif | image/avif | AVIF Image | — | Download |
| .heic | image/heic | HEIC Image (iPhone) | — | Download |
| .heif | image/heif | HEIF Image | — | Download |
| .svg | image/svg+xml | SVG Vector | <svg | Download |
| .ico | image/x-icon | ICO Icon | 00 00 01 00 | Download |
| .bmp | image/bmp | BMP Bitmap | 42 4D | Download |
| .tiff | image/tiff | TIFF Image | 49 49 2A 00 | Download |
| .tif | image/tiff | TIFF Image | 49 49 2A 00 | Download |
| .apng | image/apng | Animated PNG | 89 50 4E 47 | — |
| .psd | image/vnd.adobe.photoshop | Photoshop Document | 38 42 50 53 | — |
| .ai | application/postscript | Adobe Illustrator | — | — |
| .eps | application/postscript | Encapsulated PostScript | — | — |
| .raw | image/x-raw | Camera RAW | — | — |
| .cr2 | image/x-canon-cr2 | Canon RAW | — | — |
| .nef | image/x-nikon-nef | Nikon RAW | — | — |
| .jxl | image/jxl | JPEG XL | — | — |
| .mp4 | video/mp4 | MP4 Video | 66 74 79 70 | Download |
| .mkv | video/x-matroska | MKV (Matroska) | 1A 45 DF A3 | Download |
| .webm | video/webm | WebM Video | 1A 45 DF A3 | Download |
| .mov | video/quicktime | QuickTime MOV | 66 74 79 70 | Download |
| .avi | video/x-msvideo | AVI Video | 52 49 46 46 | Download |
| .wmv | video/x-ms-wmv | Windows Media Video | 30 26 B2 75 | — |
| .flv | video/x-flv | Flash Video | 46 4C 56 | — |
| .m4v | video/mp4 | M4V (iTunes Video) | — | — |
| .3gp | video/3gpp | 3GP Mobile Video | — | — |
| .ts | video/mp2t | MPEG Transport Stream | — | — |
| .m3u8 | application/vnd.apple.mpegurl | HLS Playlist | — | — |
| .mpd | application/dash+xml | DASH Manifest | — | — |
| .mp3 | audio/mpeg | MP3 Audio | FF FB / 49 44 33 | Download |
| .wav | audio/wav | WAV Audio | 52 49 46 46 | Download |
| .flac | audio/flac | FLAC Lossless Audio | 66 4C 61 43 | Download |
| .aac | audio/aac | AAC Audio | FF F1 | Download |
| .ogg | audio/ogg | OGG Vorbis Audio | 4F 67 67 53 | Download |
| .opus | audio/opus | Opus Audio | — | — |
| .m4a | audio/mp4 | M4A (AAC in MP4) | — | — |
| .wma | audio/x-ms-wma | Windows Media Audio | — | — |
| .aiff | audio/aiff | AIFF Audio (Apple) | 46 4F 52 4D | — |
| .mid | audio/midi | MIDI Audio | 4D 54 68 64 | — |
| .midi | audio/midi | MIDI Audio | 4D 54 68 64 | — |
| .zip | application/zip | ZIP Archive | 50 4B 03 04 | Download |
| .tar | application/x-tar | TAR Archive | 75 73 74 61 72 | — |
| .gz | application/gzip | Gzip Compressed | 1F 8B | — |
| .tar.gz | application/gzip | Gzip Tarball | 1F 8B | Download |
| .tgz | application/gzip | Gzip Tarball (.tgz) | 1F 8B | Download |
| .bz2 | application/x-bzip2 | Bzip2 Compressed | 42 5A 68 | — |
| .tar.bz2 | application/x-bzip2 | Bzip2 Tarball | 42 5A 68 | Download |
| .xz | application/x-xz | XZ Compressed | FD 37 7A 58 5A | — |
| .7z | application/x-7z-compressed | 7-Zip Archive | 37 7A BC AF 27 1C | Download |
| .rar | application/vnd.rar | RAR Archive | 52 61 72 21 | Download |
| .zst | application/zstd | Zstandard Compressed | 28 B5 2F FD | — |
| .lz4 | application/x-lz4 | LZ4 Compressed | — | — |
| .br | application/x-brotli | Brotli Compressed | — | — |
| .iso | application/x-iso9660-image | ISO Disk Image | — | — |
| .dmg | application/x-apple-diskimage | macOS Disk Image | — | — |
| .deb | application/vnd.debian.binary-package | Debian Package | — | — |
| .rpm | application/x-rpm | RPM Package | — | — |
| .ttf | font/ttf | TrueType Font | 00 01 00 00 | Download |
| .otf | font/otf | OpenType Font | 4F 54 54 4F | Download |
| .woff | font/woff | WOFF Web Font | 77 4F 46 46 | — |
| .woff2 | font/woff2 | WOFF2 Web Font | 77 4F 46 32 | Download |
| .eot | application/vnd.ms-fontobject | EOT Font (Legacy IE) | — | — |
Showing first 100 of 128 results — narrow your search
Setting Content-Type headers
# Nginx
location ~* \.pdf$ {
add_header Content-Type application/pdf;
}
# Express.js
res.setHeader('Content-Type', 'application/pdf');
res.sendFile('document.pdf');
# Python (Flask)
return send_file('doc.pdf', mimetype='application/pdf')
# .htaccess (Apache)
AddType application/pdf .pdf
AddType image/avif .avif
AddType font/woff2 .woff2Frequently Asked Questions
What is a MIME type?
MIME (Multipurpose Internet Mail Extensions) type is a standard label that identifies the format of a file. It consists of a type and subtype: 'application/pdf', 'image/png', 'video/mp4'. Web servers use MIME types in the Content-Type header to tell browsers how to handle files. Without correct MIME types, browsers may download files instead of displaying them, or block them entirely.
MIME type vs file extension — What is the difference?
File extensions (.pdf, .jpg) are part of the filename — they can be changed or faked. MIME types are metadata sent by the server in HTTP headers — they describe the actual content format. Security-conscious applications check both: the extension for user-facing display, and the MIME type (or magic bytes) for actual content validation. Our MIME database shows both for each format.
How to set Content-Type header correctly?
In Nginx: add_header Content-Type application/pdf. In Express.js: res.setHeader('Content-Type', 'image/png'). In Apache: AddType image/avif .avif. Most web frameworks auto-detect MIME types, but you should explicitly set them for: new formats (AVIF, WOFF2), file downloads (Content-Disposition: attachment), and API responses (application/json).
What are magic bytes?
Magic bytes (file signatures) are the first few bytes of a file that identify its format — regardless of the file extension. For example, JPEG files always start with FF D8 FF, PNG with 89 50 4E 47. Security tools use magic bytes to detect extension spoofing (e.g., a .pdf file that's actually a JPEG). Our table shows magic bytes for each format.
Why does my browser show 'application/octet-stream' instead of the correct type?
application/octet-stream is the default fallback MIME type — it means 'unknown binary data'. Your web server isn't configured with the correct MIME type for that file extension. Fix: add the correct AddType directive (Apache), types block (Nginx), or Content-Type header (code). Use our lookup table to find the correct MIME type for any extension.
Related reading
·8 min
Generate Sample Files in the Browser (No Upload Needed)
How to generate sample files locally with Blob, TextEncoder, Uint8Array, object URLs, and a custom file size up to 1GB. No upload or backend required.
·6 min
Safe Dummy File Generator with No Upload
Create private dummy files locally in your browser with a custom file size up to 1GB. No upload, no signup, and no server storage.
·7 min
Test Upload Forms with Generated Files
A practical workflow for testing upload forms with generated TXT, CSV, JSON, XML, BIN, and SVG files. Includes custom file size checks up to 1GB.