All formats

RAR libraries

Open-source libraries that list and extract RAR archives. RAR is proprietary and no open-source library creates RAR files; to write archives use ZIP, 7z or TAR.

Many RAR libraries are built on RARLAB’s UnRAR source. Its license is free but not an OSI open-source license: the code may be used in any program that extracts RAR, but not to re-create the RAR compression algorithm. Libraries marked “UnRAR license” below carry that restriction; libarchive, SharpCompress and rardecode are independent implementations under BSD or MIT licenses.

Language Library RAR4 RAR5 Password Volumes Notes
C/C++ UnRAR library yes yes yes yes reference code from RARLAB, UnRAR license
C/C++ libarchive yes yes no yes BSD, same API for ZIP, 7z, TAR; no solid RAR4
C# SharpCompress yes yes yes yes pure managed code, MIT
Java junrar yes yes yes yes pure Java, UnRAR license
Go rardecode yes yes yes yes pure Go, BSD-2-Clause, io/fs support
Python rarfile yes yes yes yes zipfile-like API, runs unrar or another tool to decompress
Ruby ffi-libarchive yes yes no no libarchive binding, same limits as libarchive
Rust unrar yes yes yes yes binding to the UnRAR library
PHP rar extension yes yes yes yes PECL extension with bundled UnRAR, rar:// stream wrapper

By language#