XZ Utils is free general-purpose data compression software with high compression ratio. XZ Utils were written for POSIX-like systems, but also work on some not-so-POSIX systems. XZ Utils are the successor to LZMA Utils.
The core of the XZ Utils compression code is based on LZMA SDK, but it has been modified quite a lot to be suitable for XZ Utils. The primary compression algorithm is currently LZMA2, which is used inside the .xz container format. With typical files, XZ Utils create 30 % smaller output than gzip and 15 % smaller output than bzip2.
XZ Utils consist of several components:
- liblzma is a compression library with API similar to that of zlib.
- xz is a command line tool with syntax similar to that of gzip.
- xzdec is a decompression-only tool smaller than the full-featured xz tool.
- A set of shell scripts (xzgrep, xzdiff, etc.) have been adapted from gzip to ease viewing, grepping, and comparing compressed files.
- Emulation of command line tools of LZMA Utils eases transition from LZMA Utils to XZ Utils.
While liblzma has a zlib-like API, liblzma doesn't include any file I/O functions. A separate I/O library is planned, which would abstract handling of .gz, .bz2, and .xz files with an easy to use API.
The files have been signed with this OpenPGP key.
See the NEWS file for a summary of changes between versions.
The new APIs, command line options etc. in development releases should be considered unstable. Incompatible changes to unstable features may be done before they get included in a stable release.
git clone http://git.tukaani.org/xz.git
- master: the latest development code
- v5.0: fixes for the next 5.0.x release
Building the code from the git repository requires GNU Autotools. Here are the minimum versions that should work with XZ Utils; using the latest versions is strongly recommended:
- Autoconf 2.64
- Automake 1.10
- gettext 0.18 (Note: autopoint depends on cvs!)
- libtool 2.2
Many free software operating systems already provide easy-to-install XZ Utils binaries. It doesn't make sense to provide links to all those here. Instead, binaries or links to websites providing binaries are listed here only for operating systems that don't have well-known repositories where users would get software like this.
If you have a website that provides up-to-date XZ Utils binaries for an operating system that meets the the criteria above, let me know and I will include a link here. Note that I won't host the binaries themselves without a good reason.
The Windows version of XZ Utils includes binaries for 32-bit and 64-bit x86. The 32-bit version requires only i486 instructions and thus will work on old computers. The binaries only depend on msvcrt.dll, which is available on Windows 98 and later out of the box (on Windows 95 you may need to install msvcrt.dll separately).
- Command line tools: xz, xzdec, lzmadec, lzmainfo
- Shared (DLL) and static liblzma, required C header files, and liblzma.def to create import libraries for non-GNU toolchains (no import library is needed with GNU toolchain)
- Documentation is in plain text (UTF-8) format. The man pages of the command line tools are included also as PDF.
Mac OS X
Anders F Björklund has made a XZ Utils binary package for Mac OS X 10.5 and later (for ppc, i386, and x86_64).
The DOS version of XZ Utils includes only the xz command line tool and some documentation. The xz tool should work e.g. on FreeDOS (also in DOSEMU), MS-DOS, and Windows 95/98/98SE/ME. This doesn't necessarily work in DOSBox at all, and at least some problems are expected under Windows XP Command Prompt (signal handling doesn't work).
Since the DOS version is naturally going to get very little testing, it is recommended to use the Windows version instead of the DOS version if you need xz under Windows 95 or later. It is likely that that the DOS version will be updated only occasionally.
Juan Manuel Guerrero has made a more complete port of XZ Utils to DOS. It also has support for short file names (8.3), which isn't yet in the upstream code. It is available from DJGPP mirrors under /current/v2apps (e.g. xz-500b.zip for 5.0.0 binaries).
Source and binary packages of old XZ Utils releases are available on a separate page.
Below is an incomplete and somewhat vague (version numbers mostly missing) list of operating systems on which XZ Utils should work. The compiler(s) or toolchains are mentioned in parenthesis. GCC refers to GCC 3 or later. If you have additions or corrections, please email them to me.
- GNU/Linux (GCC, LLVM/Clang, ICC)
- GNU/HURD (GCC)
- DragonflyBSD (GCC)
- FreeBSD (GCC)
- MirBSD (GCC)
- NetBSD (GCC)
- OpenBSD (GCC)
- MINIX 3 (GCC) 
- Haiku (GCC4)
- Mac OS X (GCC)
- Solaris 10, 11 (GCC, Sun Studio 12)
- Solaris 8, 9 (GCC) 
- HP-UX (GCC, HP ANSI C) 
- Tru64 (GCC, Compaq C compiler) 
- IRIX (MIPSpro) 
- AIX (GCC)
- QNX (compilers?)
- OpenVMS (HP C compiler) 
- OpenVOS 17 (GCC)
- Windows 95 and later (GCC/MinGW, GCC/MinGW-w64, GCC/Cygwin, GCC/Interix) 
- OS/2, eComStation (GCC)
- DOS e.g. FreeDOS and MS-DOS (GCC/DJGPP) 
 See also the platform-specific notes in the INSTALL file.
 2010-09-22: HP ANSI C compiler crashes when compiling XZ Utils on PA-RISC. On Itanium there are no problems.
 Someone with Solaris 8 or 9 could test if compiling XZ Utils works also with Sun Studio. It probably won't work out of the box, but passing CC="cc -xc99=all,no_lib" ac_cv_prog_cc_c99= to configure might make it work.
The most interesting parts of XZ Utils (e.g. liblzma) are in the public domain. You can do whatever you want with the public domain parts.
Some parts of XZ Utils (e.g. build system and some utilities) are under different free software licenses such as GNU LGPLv2.1, GNU GPLv2, or GNU GPLv3.