You have a file, you do not recognise the extension, and you want to know what it is and what will open it. This page is that lookup, organised by category and covering the formats you are realistically likely to meet — plus a clear list of the extensions that can execute code, which is the one distinction genuinely worth knowing.
Before you look anything up
The extension is a label, not the file. It tells your operating system which program to launch; it does not describe or change the data. That is why renaming never converts anything, and why a file called invoice.pdf.exe is a program regardless of what its icon suggests.
Images
| Extension | Format | Opens with |
|---|---|---|
.jpg .jpeg | JPEG — lossy photographic | Everything |
.png | Lossless, supports transparency | Everything |
.gif | 256 colours, animation | Everything |
.webp | Google's modern format | All current browsers, most editors |
.avif | AV1-based, best compression | Current browsers; editor support patchy |
.heic .heif | Apple's default photo format | Apple devices; Windows needs a codec |
.svg | Vector — text-based XML | Browsers, Illustrator, Inkscape, Figma |
.bmp | Uncompressed bitmap | Everything; files are huge |
.tif .tiff | Print and archival, often layered | Photoshop, GIMP, Preview; not browsers |
.psd | Photoshop layered document | Photoshop, GIMP, Affinity, Photopea |
.ai | Illustrator vector document | Illustrator, Inkscape (partial) |
.eps | Encapsulated PostScript | Illustrator, Ghostscript |
.raw .cr2 .cr3 .nef .arw .dng .orf .raf | Camera raw sensor data | Lightroom, Capture One, darktable, RawTherapee |
.ico | Windows icon, multiple sizes | Browsers, icon editors |
.xcf | GIMP native document | GIMP only |
The raw formats deserve a note: every camera manufacturer uses its own, and they are not interchangeable. .cr3 is Canon, .nef is Nikon, .arw is Sony, .raf is Fujifilm, .orf is Olympus. .dng is Adobe's attempt at a universal raw format, and it is the one to convert to if you care about opening these files in twenty years.
Documents
| Extension | Format | Opens with |
|---|---|---|
.pdf | Portable Document Format | Browsers, Acrobat, Preview, everything |
.doc | Word 97–2003 binary | Word, LibreOffice, Google Docs |
.docx | Word XML (a ZIP archive) | Word, LibreOffice, Pages, Google Docs |
.docm | Word with macros — can run code | Word |
.xls .xlsx | Excel spreadsheet | Excel, LibreOffice, Numbers, Sheets |
.xlsm | Excel with macros — can run code | Excel |
.ppt .pptx | PowerPoint presentation | PowerPoint, LibreOffice, Keynote, Slides |
.odt .ods .odp | OpenDocument text / sheet / slides | LibreOffice, OpenOffice, Word (mostly) |
.pages .numbers .key | Apple iWork documents | Apple apps or iCloud web only |
.rtf | Rich Text Format | Any word processor |
.txt | Plain text | Any text editor |
.md | Markdown | Any text editor; renders in most dev tools |
.epub | Ebook (a ZIP of HTML) | Calibre, Apple Books, most e-readers |
.mobi .azw3 | Kindle formats | Kindle, Calibre |
.tex | LaTeX source | TeX distributions, Overleaf |
.pub | Microsoft Publisher | Publisher only — notoriously hard to convert |
Audio and video
| Extension | Format | Notes |
|---|---|---|
.mp3 | MPEG audio, lossy | Universal compatibility |
.wav | Uncompressed PCM audio | Large; the editing standard |
.flac | Lossless compressed audio | About half the size of WAV, no quality loss |
.aac .m4a | Advanced Audio Coding | Apple and streaming default |
.ogg .opus | Open formats | Opus is the best low-bitrate codec available |
.wma | Windows Media Audio | Legacy; convert it |
.aiff | Apple uncompressed audio | WAV equivalent |
.mid .midi | Note instructions, not audio | Tiny files; sound depends on the synthesiser |
.mp4 .m4v | MPEG-4 container | The safe default for video |
.mov | QuickTime container | Apple standard; usually plays anywhere |
.mkv | Matroska container | Very flexible; VLC handles it, browsers do not |
.avi | Legacy Windows container | Old but everywhere |
.webm | Open web video container | Browser-native |
.flv | Flash video | Obsolete; convert to MP4 |
.wmv | Windows Media Video | Legacy |
.srt .vtt .ass | Subtitle files | Plain text; open in any editor |
💡 Container versus codec
Video extensions name the container — the box — not the codec — the compression inside it. An .mp4 can hold H.264, H.265, AV1 or several others. This is why two files with the same extension can behave completely differently: one plays everywhere, the other fails on the same device. When a video will not play, the codec is usually the culprit, not the extension.
Archives and disk images
| Extension | Format | Opens with |
|---|---|---|
.zip | The universal archive | Built into every OS |
.rar | Proprietary, good compression | WinRAR, 7-Zip, The Unarchiver |
.7z | 7-Zip — best free compression | 7-Zip, Keka |
.tar | Bundles files, no compression | Any archiver |
.gz .tar.gz .tgz | Gzip-compressed tar | The Unix standard |
.bz2 .xz | Higher-ratio Unix compression | Any archiver |
.iso | Optical disc image | Mount directly; treat attachments with suspicion |
.dmg | macOS disk image | macOS only |
.cab | Microsoft cabinet | Windows, 7-Zip |
Code and data
| Extension | Format |
|---|---|
.html .htm | Web page |
.css | Stylesheet |
.js .mjs .cjs | JavaScript |
.ts .tsx .jsx | TypeScript / React source |
.json | Structured data |
.xml | Structured markup |
.yaml .yml | Human-readable configuration |
.toml .ini .conf .env | Configuration files |
.csv .tsv | Delimited tabular data |
.sql | Database queries |
.db .sqlite .sqlite3 | SQLite database file |
.py | Python |
.java .class .jar | Java source / bytecode / archive |
.c .h .cpp .hpp | C and C++ |
.cs | C# |
.go .rs .rb .php .swift .kt | Go, Rust, Ruby, PHP, Swift, Kotlin |
.sh .bash .zsh | Shell scripts — executable |
.log | Plain-text application log |
.parquet | Columnar analytics data |
Fonts, 3D and design
| Extension | Format | Notes |
|---|---|---|
.ttf .otf | TrueType / OpenType font | Install by double-clicking |
.woff .woff2 | Web font | For CSS @font-face, not installation |
.fig | Figma document | Figma only |
.sketch | Sketch document | macOS Sketch |
.xd | Adobe XD | XD |
.indd | InDesign layout | InDesign only |
.stl .obj .3mf | 3D models for printing | Slicers, Blender, CAD tools |
.blend | Blender scene | Blender |
.dwg .dxf | AutoCAD drawings | AutoCAD, LibreCAD, FreeCAD |
.gltf .glb | 3D for web and AR | Browsers, Blender |
Extensions that can run code
This is the section worth memorising. Everything in the tables above is data — it is inert until a program interprets it. Everything below is an instruction, and double-clicking it hands control to whoever wrote it.
🚨 Never open these from an untrusted source
| Extension | What it is |
|---|---|
.exe .com .scr | Windows executables. .scr is a screensaver, which is simply an executable with a different name. |
.msi .msix | Windows installers — run with elevated privileges. |
.bat .cmd | Batch scripts. |
.ps1 | PowerShell — extremely capable, heavily used in attacks. |
.vbs .vbe .wsf | Windows Script Host scripts. |
.hta | HTML application — runs outside the browser sandbox entirely. |
.jar | Java archive — executes if a Java runtime is installed. |
.lnk | A shortcut that can point at any command with any arguments. |
.reg | Edits the Windows registry on double-click. |
.docm .xlsm .pptm | Office files with macros embedded. |
.app .command .pkg | macOS applications, scripts and installers. |
.sh | Shell scripts on macOS and Linux. |
.iso .img .vhd | Disc images. Not executable themselves, but mount as a drive — now a standard way to smuggle an .exe past email scanners. |
The double extension trick
Windows hides extensions for known file types by default. A file genuinely named invoice.pdf.exe therefore displays as invoice.pdf — and if the attacker sets a PDF icon, it looks entirely convincing. Only the final extension determines what happens when you open it.
This trick is roughly twenty-five years old and still works, because the default setting that enables it has never changed. Turning extensions on takes ten seconds and is the single highest-value security setting on a Windows machine:
A related trick uses right-to-left override characters to make annexe.fdp.exe render as annexe.exe.pdf. Showing extensions does not defeat that one, which is why the more general rule matters: be suspicious of any attachment you did not ask for, regardless of how the name reads.
Identifying a file with no extension
Extensions get stripped by download managers, email gateways and careless file transfers. The data is intact — you just need to work out what it is. Every method below reads the file's actual signature rather than trusting its name.
Then match against the common signatures:
| First bytes | Reads as | Format |
|---|---|---|
25 50 44 46 2D | %PDF- | |
89 50 4E 47 | .PNG | PNG |
FF D8 FF | — | JPEG |
47 49 46 38 | GIF8 | GIF |
50 4B 03 04 | PK.. | ZIP, DOCX, XLSX, EPUB, JAR, APK |
52 61 72 21 | Rar! | RAR |
1F 8B | — | GZIP |
4D 5A | MZ | Windows executable |
7F 45 4C 46 | .ELF | Linux executable |
49 44 33 | ID3 | MP3 with tags |
53 51 4C 69 | SQLi | SQLite database |
⚠️ If it starts with MZ, stop
4D 5A — the letters MZ, the initials of DOS architect Mark Zbikowski — means the file is a Windows executable, whatever its name claims. If you were expecting a document and find MZ, delete it.
Formats that are secretly ZIP files
A surprising number of modern formats are ZIP archives with a specified internal layout. You can open any of them with an archiver and read the contents directly:
.docx,.xlsx,.pptx— Office XML documents.odt,.ods,.odp— OpenDocument.epub— HTML, CSS and images plus a manifest.jar,.war— Java archives.apk,.aab— Android packages.xpi— Firefox extensions.3mf— 3D manufacturing format.sketch— Sketch documents (JSON inside)
This is genuinely useful for recovery. If Word declares a .docx corrupt, rename a copy to .zip, open it, and look in word/media/ — every image from the document is sitting there as an ordinary file, and word/document.xml holds the text.
Working with an unfamiliar format?
Convert images, merge PDFs, reformat JSON and more — every tool runs in your browser, so nothing is uploaded anywhere.
Browse all tools →Four rules that cover everything
- The extension is a label. It tells the OS which program to open; it says nothing about the contents and changing it converts nothing.
- The bytes tell the truth. When name and behaviour disagree, check the signature.
- Only the last extension counts.
report.pdf.exeis an executable. - Turn on extension display. Ten seconds of configuration that defeats a whole class of attack.
Frequently Asked Questions
How do I find out what a file is if it has no extension?
Inspect its first bytes. Almost every binary format begins with a fixed signature — PDFs start with %PDF-, PNGs with a byte sequence containing PNG, ZIP-based files with PK. On macOS or Linux, run 'file yourfile' to identify it instantly. On Windows, open it in a hex viewer and look at the first 8 bytes, or just try renaming a copy with a likely extension.
Which file extensions are dangerous to open?
Anything that can execute code: .exe, .scr, .com, .bat, .cmd, .ps1, .vbs, .js, .jar, .msi, .hta, .lnk and .reg on Windows; .app, .command and .pkg on macOS. Also treat Office files containing macros (.docm, .xlsm, .pptm) with suspicion, and .iso or .img attachments, which have become a common way to smuggle executables past email filters.
Does changing a file extension convert the file?
No. The extension is part of the filename, not the data. Renaming song.wav to song.mp3 leaves you with WAV data under a misleading name — most players will either refuse it or detect the real format and ignore the extension. Converting requires software that actually re-encodes the contents.
Why do .docx and .zip look the same to some programs?
Because a .docx file genuinely is a ZIP archive. Modern Office formats, EPUB books, Java .jar files and Android .apk packages are all ZIP containers with a defined internal structure. Rename a .docx to .zip and you can open it and read the XML inside.
What is a double extension and why does it matter?
A file named invoice.pdf.exe is an executable, not a PDF — the last extension is the real one. Because Windows hides known extensions by default, that file displays as 'invoice.pdf' with what appears to be a document icon. It is one of the oldest and still most effective malware delivery tricks. Turn extension display on.