REF-006 • Tech Reference Tech

File Extensions

A practical guide to common file extensions for documents, images, audio, video, archives, programs, web files, code, and structured data.

Published
Formats Archives Code Safety
50+ Common Extensions
10+ File Families
≠ Extension ≠ Format
Quick Answer

A file extension is the suffix at the end of a filename, usually after the final period: .pdf, .jpg, .mp4, .zip, or .exe. It usually tells the operating system and applications what kind of file they are dealing with. The extension is only a label, however: renaming photo.jpg to photo.png does not actually convert the JPEG data into PNG.

Quick Lookup

Common File Extensions

Use this table as a fast lookup for common extensions. Some formats can use more than one extension, and a single extension can occasionally be associated with different applications or variants.

Extension Type Meaning / Format Typical Use
.txt Text Plain text Notes, logs, simple text data
.pdf Document Portable Document Format Fixed-layout documents and forms
.docx Document Office Open XML document Microsoft Word documents
.xlsx Spreadsheet Office Open XML workbook Microsoft Excel spreadsheets
.pptx Presentation Office Open XML presentation Microsoft PowerPoint slides
.csv Data Comma-separated values Tabular data exchange
.json Data JavaScript Object Notation Structured application and API data
.xml Data Extensible Markup Language Structured documents and data
.md Text Markdown Formatted plain-text documentation
.jpg / .jpeg Image JPEG Photographs and compressed images
.png Image Portable Network Graphics Graphics, transparency, screenshots
.gif Image Graphics Interchange Format Simple animation and graphics
.webp Image WebP Web images and animation
.avif Image AV1 Image File Format Modern compressed web images
.svg Image Scalable Vector Graphics Vector graphics, icons, diagrams
.heic Image HEIF image container High-efficiency phone photography
.mp3 Audio MPEG audio Compressed music and audio
.wav Audio Waveform Audio File Format High-quality or uncompressed audio
.flac Audio Free Lossless Audio Codec Lossless music and archival audio
.m4a Audio MPEG-4 audio container Compressed audio and music
.mp4 Video MPEG-4 container Video, audio, captions, metadata
.mov Video QuickTime File Format Video production and editing
.mkv Video Matroska container Video with multiple tracks
.webm Video WebM Web-oriented audio and video
.zip Archive ZIP archive Compressed groups of files
.7z Archive 7-Zip archive High-compression archives
.rar Archive RAR archive Compressed file archives
.tar Archive Tar archive Bundling files, common on Unix systems
.gz Compression gzip Compressed files and tar archives
.iso Disk Image Optical-disc image Install media and disc copies
.exe Program Windows executable Windows applications and installers
.msi Installer Windows Installer package Software installation
.apk Package Android application package Android application distribution
.html Web HyperText Markup Language Web-page structure
.css Web Cascading Style Sheets Web-page presentation
.js Code JavaScript Web and application scripting
.py Code Python source Python programs and scripts
Extensions Are Usually Case-Insensitive in Everyday Use

.JPG and .jpg usually identify the same format. However, operating systems and file systems do not all handle filename case identically, so software should not always assume that capitalization is irrelevant.

Documents & Structured Data

Document & Data Extensions

Document extensions can represent plain text, fixed-layout documents, editable office files, spreadsheets, presentations, or structured machine-readable data.

Extension Format Typical Use Notes
.txt Plain text Notes, configuration, logs No required rich formatting
.pdf PDF Documents and forms Designed for consistent layout
.docx Word document Editable documents ZIP-based Office Open XML container
.xlsx Excel workbook Spreadsheets Can contain multiple worksheets
.pptx PowerPoint presentation Slides Office Open XML presentation format
.rtf Rich Text Format Formatted text exchange Older but broadly understood
.odt OpenDocument Text Editable documents OpenDocument standard
.ods OpenDocument Spreadsheet Spreadsheets OpenDocument standard
.csv Delimited text data Tables and data exchange Delimiter and encoding can vary
.json JSON APIs and structured data Text-based key/value and array structures
.xml XML Structured data and documents Uses nested markup elements
.md Markdown Documentation and notes Plain text with lightweight markup
Macro-Enabled Office Files

Extensions such as .docm, .xlsm, and .pptm identify Microsoft Office files that can contain VBA macros. Treat unexpected macro-enabled documents more cautiously than ordinary documents from a trusted source.

Raster & Vector

Image File Extensions

Image formats differ in compression, transparency, animation support, color depth, metadata, and whether the artwork is stored as pixels or scalable vector geometry.

Extension Type Strength Common Use
.jpg / .jpeg Raster Efficient photographic compression Photos and web imagery
.png Raster Lossless compression and transparency Graphics, screenshots, UI assets
.gif Raster Simple frame animation Animations and simple graphics
.webp Raster Modern web compression Web photos, graphics, animation
.avif Raster High compression efficiency Modern web imagery
.svg Vector Scales without pixelation Logos, icons, diagrams
.heic Raster / container Efficient high-quality storage Phone photography
.tif / .tiff Raster High-quality image storage Publishing, scanning, archival workflows
.bmp Raster Simple bitmap representation Legacy Windows graphics
.ico Icon container Multiple icon sizes Windows icons and favicons
JPG and JPEG

.jpg and .jpeg normally refer to the same JPEG image format. The three-letter form became common when older systems imposed shorter filename-extension conventions.

Media Files

Audio & Video Extensions

Media filenames often identify a container format rather than one specific codec. An .mp4 file, for example, can contain video, audio, captions, metadata, and different supported codec combinations.

Extension Category Typical Use Notes
.mp3 Audio Music and spoken audio Lossy compressed audio
.wav Audio Recording and editing Often PCM audio, though the container supports variations
.flac Audio Lossless music Compresses without discarding decoded audio data
.aac Audio Compressed audio AAC elementary audio
.m4a Audio container Music and podcasts MPEG-4 container commonly used for audio
.ogg Media container Audio and other media Can contain different codecs
.mp4 Video container Web, mobile, social video Very widely supported container
.mov Video container Editing and media production QuickTime File Format
.mkv Video container Multi-track video Matroska container
.webm Video container Web playback Designed for web media
.avi Video container Legacy video workflows Older Microsoft container format
.m4v Video container MPEG-4 video Closely related to MP4 workflows
Container Does Not Tell You Everything

Two files can both end in .mp4 yet contain different video or audio codecs. That is why one MP4 may play on a device while another requires additional codec support.

Compression & Containers

Archives, Images & Packages

Archive and package formats can bundle multiple files into one container. Some add compression, while others mainly preserve directory structures, installation data, or disk contents.

Extension Type Common Use Notes
.zip Archive General file compression Widely supported across operating systems
.7z Archive Compressed archives Commonly associated with 7-Zip
.rar Archive Compressed archives RAR archive format
.tar Archive Bundling files Traditionally archives without compression
.gz Compression Compressing individual data streams Often combined with tar
.tar.gz / .tgz Compressed archive Unix/Linux software and backups Tar archive compressed with gzip
.iso Disk image Disc media and installers Represents an optical-disc filesystem image
.dmg Disk image macOS software distribution Apple disk-image format
.apk Application package Android applications ZIP-based package containing app resources and code
.msi Installer package Windows software installation Handled by Windows Installer
Compound Extensions

.tar.gz is a useful example of a compound extension. The .tar portion describes the archive structure, while .gz indicates gzip compression.

Applications, Scripts & Web

Program & Code Extensions

Code extensions can identify source code, scripts, web assets, compiled programs, libraries, or operating-system files. Whether a file can execute directly depends on the platform and software handling it.

Extension Type Typical Use Execution Risk
.exe Windows executable Applications and installers Can run executable code
.bat Batch script Windows command automation Can execute commands
.cmd Command script Windows command automation Can execute commands
.ps1 PowerShell script Windows administration and automation Can execute PowerShell commands
.sh Shell script Unix/Linux/macOS automation Can execute shell commands when permitted
.html Markup Web-page structure Opened by browsers; may reference active content
.css Stylesheet Web presentation Not a standalone executable program
.js JavaScript Web and application scripting Executable in supported runtimes
.ts TypeScript Typed application source code Usually compiled or transformed first
.php PHP source Server-side web applications Executed by a PHP environment
.py Python source Applications, scripts, automation Executed by a Python interpreter
.java Java source Application source code Normally compiled before execution
.c C source Compiled software Source code, not normally directly executed
.cpp C++ source Compiled software Source code, not normally directly executed
.dll Dynamic library Shared Windows program code Loaded by other software
Source Matters More Than the Icon

Do not assume a file is safe because it has a familiar icon or filename. Executables, scripts, installers, shortcuts, and macro-enabled documents should be opened only when their source and purpose are understood.

File Family Comparison

Common Extension Families

These examples represent six common file families. The extension identifies the expected format or handling convention, while the actual data inside the file determines what it truly contains.

Document PDF

Fixed-layout documents, forms, reports, and publications.

Image JPEG

Compressed raster photography and general-purpose imagery.

Media MPEG-4

A multimedia container commonly used for video and audio.

Archive ZIP

Packages multiple files and directories into one archive.

Program Executable

Windows program file capable of containing executable code.

Web HTML

Text markup that defines the structure of a web page.

What the Suffix Really Means

Extension vs File Format

A file extension is useful metadata in the filename, but it is not the same thing as the underlying file format. Software may use several signals when determining how to interpret a file.

Extension Filename Suffix

The visible ending such as .pdf, .png, or .zip.

Format Data Structure

The rules describing how information is actually encoded inside the file.

MIME Media Type

Metadata such as image/png or application/pdf used when software exchanges content.

Signature File Header

Characteristic bytes near the start of many formats that software can use to identify the underlying data.

Renaming Is Not Conversion

Changing photo.jpg to photo.png does not transform JPEG data into PNG. A proper converter must decode the original file and write a new file using the destination format.

Some Familiar Files Are Containers

Modern Office files such as .docx, .xlsx, and .pptx are structured ZIP-based containers. Android .apk packages also use a ZIP-based structure. The extension tells software how that container should be interpreted.

Dotfiles Are Different

A filename such as .gitignore begins with a period but is commonly treated as a hidden or configuration filename rather than a normal filename plus extension. Extension parsing therefore depends on filename conventions and application context.

File Handling

Safety & Unknown Extensions

The extension can provide a useful warning about how a file may behave, but it does not prove that a file is safe or malicious. Consider the source, expected purpose, full filename, and the software that will open it.

Extension Type Why to Notice It
.exe Executable Can contain directly executable Windows program code
.msi Installer Can install or modify Windows software
.bat / .cmd Command scripts Can execute sequences of system commands
.ps1 PowerShell script Can perform powerful system automation
.vbs VBScript Can execute scripted actions on supported Windows systems
.scr Windows screensaver executable Can contain executable code despite the screensaver label
.lnk Windows shortcut Can launch another program, file, command, or location
.docm / .xlsm Macro-enabled Office files May contain executable VBA macros
Watch for Double Extensions

A filename such as invoice.pdf.exe is an executable ending in .exe, even though .pdf also appears in the name. Showing complete filename extensions makes this easier to notice.

Showing File Extensions

On Windows 11, File Explorer provides a View → Show → File name extensions option. On macOS, Finder can show all filename extensions through its Advanced settings. Other desktop environments and file managers provide similar controls.

Unknown Extension?

Check the complete filename, where the file came from, what application created it, and what program is expected to open it. Avoid running an unfamiliar executable or script merely to discover what it does.

FAQ

File Extension Questions

What is a file extension?

A file extension is the suffix at the end of a filename, usually after a period. Examples include .pdf, .jpg, .zip, and .exe. It commonly indicates the expected file format or the type of software used to handle the file.

Does changing a file extension convert the file?

No. Renaming photo.jpg to photo.png only changes the filename. The underlying image remains encoded as JPEG until conversion software actually decodes it and saves new PNG data.

Are .jpg and .jpeg the same format?

Yes. .jpg and .jpeg normally identify the same JPEG image format. The shorter form became common on older systems that favored three-character extensions.

What is the difference between a file extension and a MIME type?

The extension is part of the filename. A MIME or media type is metadata used by software and network protocols to identify content. For example, .png commonly corresponds to image/png.

What is a compound file extension?

A compound extension uses more than one suffix. For example, .tar.gz describes a tar archive that has then been compressed with gzip.

Which file extensions can run programs or scripts?

Depending on the operating system and configuration, examples include .exe, .msi, .bat, .cmd, .ps1, .vbs, .js, .scr, and executable shell scripts.

What should I do with an unknown file extension?

Check the file's source, complete filename, associated application, and expected purpose before opening it. If it is an unfamiliar executable, installer, shortcut, or script, do not run it simply to identify its contents.