UPX 5.1.1
Overview
UPX (the Ultimate Packer for eXecutables) is a free, secure, portable, and high-performance executable compressor. It typically reduces file sizes of programs and DLLs by 50%-70%, reducing disk space, network load times, download times, and other distribution costs.
Programs compressed by UPX are completely self-contained and run exactly as before, with no runtime or memory penalty for most supported formats due to in-place decompression. Decompression speed exceeds 500 MB/s on modern machines.
UPX is written in portable endian-neutral C++, distributed under the GNU General Public License v2+ with special exceptions granting free usage for all binaries including commercial programs.
Version 5.1.1 was released on March 5, 2026 and adds support for ELF MIPS r3000 (32-bit) shared libraries among other bug fixes.
When to Use
- Reducing distribution size of compiled executables and DLLs
- Optimizing storage or bandwidth for software delivery
- Compressing bootable Linux kernel images (vmlinuz)
- Packing executables for embedded systems with limited flash memory
- Creating smaller release builds for Windows, Linux, macOS, or DOS targets
- Any scenario where executable file size matters and the target format is supported by UPX
Core Concepts
Compression levels: Levels -1 through -9 plus --best. Default is -8 for files under 512 KiB, -7 otherwise. Levels 1-3 are fast, 4-6 balanced, 7-9 favor ratio, and --best may take a long time.
In-place decompression: For most formats UPX decompresses directly into memory with no temporary files and no runtime overhead beyond the small stub.
Compression algorithms: NRV (default, very fast) and LZMA (--lzma flag, better ratio but significantly slower decompression).
Overlay handling: Auxiliary data attached after an executable's logical end. UPX can copy (default), strip, or skip files with overlays.
Security context: UPX inherits the security context of any files it handles. Packing, unpacking, testing, or listing a file requires the same security considerations as executing it. Use only on trusted files.
Byte-identical round-trip: For most formats, decompressing a packed file produces a byte-identical copy of the original.
Usage Examples
Compress an executable (default operation):
upx program.exe
Decompress a packed executable:
upx -d program.exe
Test integrity of a compressed file:
upx -t program.exe
List information about compressed files:
upx -l program.exe
Best compression with brute force method selection:
upx --brute program.exe
Ultra brute force for maximum compression:
upx --ultra-brute program.exe
Compress with LZMA algorithm (better ratio, slower decompression):
upx --lzma program.exe
Strip overlay data from the executable:
upx --overlay=strip program.exe
Keep backup of original file:
upx -k program.exe
Write output to a specific file:
upx -o compressed.bin program.exe
Quiet mode (suppress warnings):
upx -q program.exe
Compress a Linux kernel image:
upx -9 bzImage
Advanced Topics
Supported Executable Formats: Complete list of all supported formats with architecture details and format-specific options → Supported Formats
Command-Line Reference: All options, compression tuning, overlay handling, and environment variable configuration → Command-Line Reference
Linux-Specific Details: ELF decompression modes, SELinux compatibility, kernel support, and shared library considerations → Linux Platform Guide
Windows PE Details: Resource compression, icon handling, relocation stripping, DLL support, and Wine compatibility → Windows PE Guide