Common File Extensions Reference
A file extension is the suffix that hints at a file's type and default opener. This table covers common text, code, image, document, audio/video and font extensions with meanings.
| Extension | Type | Meaning |
|---|---|---|
| .txt | Text | Plain text file |
| .md | Text | Markdown text |
| .html | Web | Hypertext markup page |
| .htm | Web | HTML page (short extension) |
| .css | Web | Cascading style sheet |
| .js | Code | JavaScript script |
| .ts | Code | TypeScript source |
| .json | Data | JSON data |
| .xml | Data | Extensible markup language |
| .csv | Data | Comma-separated values |
| .yaml | Data | YAML config/data |
| .yml | Data | YAML config/data (short name) |
| .toml | Data | TOML config |
| .png | Image | Lossless bitmap (supports alpha) |
| .jpg | Image | JPEG lossy image |
| .jpeg | Image | JPEG lossy image |
| .gif | Image | Animated / lossless bitmap |
| .webp | Image | Modern efficient image format |
| .svg | Image | Vector graphics |
| .ico | Image | Icon (favicon) |
| Document | Portable document | |
| .doc | Document | Legacy Word document |
| .docx | Document | Word document (OOXML) |
| .xls | Document | Legacy Excel spreadsheet |
| .xlsx | Document | Excel spreadsheet (OOXML) |
| .ppt | Document | Legacy PowerPoint |
| .pptx | Document | PowerPoint (OOXML) |
| .zip | Archive | ZIP archive |
| .rar | Archive | RAR archive |
| .7z | Archive | 7-Zip archive |
| .tar | Archive | TAR archive (often with .gz) |
| .gz | Archive | Gzip compression |
| .mp3 | Audio | MPEG audio |
| .wav | Audio | Lossless waveform audio |
| .mp4 | Video | MPEG-4 video |
| .avi | Video | AVI video container |
| .mov | Video | QuickTime video |
| .woff | Font | Web open font format |
| .woff2 | Font | Web open font format 2 (better compression) |
| .ttf | Font | TrueType font |
| .otf | Font | OpenType font |
| .exe | Binary | Windows executable |
| .dll | Binary | Dynamic-link library |
| .apk | Binary | Android package |
| .iso | Image | Disc image |
| .log | Text | Log file |
| .env | Config | Environment variable config |
| .sql | Data | SQL script |
| .db | Data | SQLite database |
| .sqlite | Data | SQLite database |
Frequently Asked Questions
What is the relationship between extension and MIME type?
The extension is the suffix at the end of a filename (e.g. .png); the MIME type (e.g. image/png) is the standard that declares content format during transfer. Servers often set Content-Type from the extension, and browsers decide how to parse from it. They are not strictly one-to-one, but most common extensions have conventional MIME types.
Which image formats are good for the web?
Photos: .jpg/.webp; transparency: .png; icons/illustrations: .svg; animation: .gif. Modern sites prefer .webp to reduce size and improve load speed.
What is the difference between .docx and .doc?
.doc is the old binary Word format; .docx is an XML-based OOXML compressed package, smaller and more robust, and is the modern Word default.
Why is a downloaded file sometimes .zip but actually code?
The extension only affects the default opener, not the real content. Archives, datasets or even malware can use any extension. To determine the real type, inspect the magic number or MIME, not the extension.