File Extension Reference: What Opens Every Common File Type

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

ExtensionFormatOpens with
.jpg .jpegJPEG — lossy photographicEverything
.pngLossless, supports transparencyEverything
.gif256 colours, animationEverything
.webpGoogle's modern formatAll current browsers, most editors
.avifAV1-based, best compressionCurrent browsers; editor support patchy
.heic .heifApple's default photo formatApple devices; Windows needs a codec
.svgVector — text-based XMLBrowsers, Illustrator, Inkscape, Figma
.bmpUncompressed bitmapEverything; files are huge
.tif .tiffPrint and archival, often layeredPhotoshop, GIMP, Preview; not browsers
.psdPhotoshop layered documentPhotoshop, GIMP, Affinity, Photopea
.aiIllustrator vector documentIllustrator, Inkscape (partial)
.epsEncapsulated PostScriptIllustrator, Ghostscript
.raw .cr2 .cr3 .nef .arw .dng .orf .rafCamera raw sensor dataLightroom, Capture One, darktable, RawTherapee
.icoWindows icon, multiple sizesBrowsers, icon editors
.xcfGIMP native documentGIMP 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

ExtensionFormatOpens with
.pdfPortable Document FormatBrowsers, Acrobat, Preview, everything
.docWord 97–2003 binaryWord, LibreOffice, Google Docs
.docxWord XML (a ZIP archive)Word, LibreOffice, Pages, Google Docs
.docmWord with macros — can run codeWord
.xls .xlsxExcel spreadsheetExcel, LibreOffice, Numbers, Sheets
.xlsmExcel with macros — can run codeExcel
.ppt .pptxPowerPoint presentationPowerPoint, LibreOffice, Keynote, Slides
.odt .ods .odpOpenDocument text / sheet / slidesLibreOffice, OpenOffice, Word (mostly)
.pages .numbers .keyApple iWork documentsApple apps or iCloud web only
.rtfRich Text FormatAny word processor
.txtPlain textAny text editor
.mdMarkdownAny text editor; renders in most dev tools
.epubEbook (a ZIP of HTML)Calibre, Apple Books, most e-readers
.mobi .azw3Kindle formatsKindle, Calibre
.texLaTeX sourceTeX distributions, Overleaf
.pubMicrosoft PublisherPublisher only — notoriously hard to convert

Audio and video

ExtensionFormatNotes
.mp3MPEG audio, lossyUniversal compatibility
.wavUncompressed PCM audioLarge; the editing standard
.flacLossless compressed audioAbout half the size of WAV, no quality loss
.aac .m4aAdvanced Audio CodingApple and streaming default
.ogg .opusOpen formatsOpus is the best low-bitrate codec available
.wmaWindows Media AudioLegacy; convert it
.aiffApple uncompressed audioWAV equivalent
.mid .midiNote instructions, not audioTiny files; sound depends on the synthesiser
.mp4 .m4vMPEG-4 containerThe safe default for video
.movQuickTime containerApple standard; usually plays anywhere
.mkvMatroska containerVery flexible; VLC handles it, browsers do not
.aviLegacy Windows containerOld but everywhere
.webmOpen web video containerBrowser-native
.flvFlash videoObsolete; convert to MP4
.wmvWindows Media VideoLegacy
.srt .vtt .assSubtitle filesPlain 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

ExtensionFormatOpens with
.zipThe universal archiveBuilt into every OS
.rarProprietary, good compressionWinRAR, 7-Zip, The Unarchiver
.7z7-Zip — best free compression7-Zip, Keka
.tarBundles files, no compressionAny archiver
.gz .tar.gz .tgzGzip-compressed tarThe Unix standard
.bz2 .xzHigher-ratio Unix compressionAny archiver
.isoOptical disc imageMount directly; treat attachments with suspicion
.dmgmacOS disk imagemacOS only
.cabMicrosoft cabinetWindows, 7-Zip

Code and data

ExtensionFormat
.html .htmWeb page
.cssStylesheet
.js .mjs .cjsJavaScript
.ts .tsx .jsxTypeScript / React source
.jsonStructured data
.xmlStructured markup
.yaml .ymlHuman-readable configuration
.toml .ini .conf .envConfiguration files
.csv .tsvDelimited tabular data
.sqlDatabase queries
.db .sqlite .sqlite3SQLite database file
.pyPython
.java .class .jarJava source / bytecode / archive
.c .h .cpp .hppC and C++
.csC#
.go .rs .rb .php .swift .ktGo, Rust, Ruby, PHP, Swift, Kotlin
.sh .bash .zshShell scripts — executable
.logPlain-text application log
.parquetColumnar analytics data

Fonts, 3D and design

ExtensionFormatNotes
.ttf .otfTrueType / OpenType fontInstall by double-clicking
.woff .woff2Web fontFor CSS @font-face, not installation
.figFigma documentFigma only
.sketchSketch documentmacOS Sketch
.xdAdobe XDXD
.inddInDesign layoutInDesign only
.stl .obj .3mf3D models for printingSlicers, Blender, CAD tools
.blendBlender sceneBlender
.dwg .dxfAutoCAD drawingsAutoCAD, LibreCAD, FreeCAD
.gltf .glb3D for web and ARBrowsers, 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

ExtensionWhat it is
.exe .com .scrWindows executables. .scr is a screensaver, which is simply an executable with a different name.
.msi .msixWindows installers — run with elevated privileges.
.bat .cmdBatch scripts.
.ps1PowerShell — extremely capable, heavily used in attacks.
.vbs .vbe .wsfWindows Script Host scripts.
.htaHTML application — runs outside the browser sandbox entirely.
.jarJava archive — executes if a Java runtime is installed.
.lnkA shortcut that can point at any command with any arguments.
.regEdits the Windows registry on double-click.
.docm .xlsm .pptmOffice files with macros embedded.
.app .command .pkgmacOS applications, scripts and installers.
.shShell scripts on macOS and Linux.
.iso .img .vhdDisc 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:

# File Explorer → View → Show → File name extensions # Or set it permanently from PowerShell: Set-ItemProperty 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' ` -Name HideFileExt -Value 0

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.

# macOS / Linux — the definitive answer file mystery file --mime-type mystery # See the first bytes anywhere xxd -l 16 mystery head -c 16 mystery | xxd # PowerShell on Windows Get-Content mystery -Encoding Byte -TotalCount 8 | ForEach-Object { '{0:X2}' -f $_ }

Then match against the common signatures:

First bytesReads asFormat
25 50 44 46 2D%PDF-PDF
89 50 4E 47.PNGPNG
FF D8 FFJPEG
47 49 46 38GIF8GIF
50 4B 03 04PK..ZIP, DOCX, XLSX, EPUB, JAR, APK
52 61 72 21Rar!RAR
1F 8BGZIP
4D 5AMZWindows executable
7F 45 4C 46.ELFLinux executable
49 44 33ID3MP3 with tags
53 51 4C 69SQLiSQLite 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

  1. The extension is a label. It tells the OS which program to open; it says nothing about the contents and changing it converts nothing.
  2. The bytes tell the truth. When name and behaviour disagree, check the signature.
  3. Only the last extension counts. report.pdf.exe is an executable.
  4. 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.

P

Written by Paras

We build free, browser-based file tools and write the reference material we wish existed when we were looking things up. Spotted an error? Tell us and we will fix it.