All formats

CBR libraries

A CBR is a RAR archive. RAR compression is proprietary: there are open-source decoders, but no open-source library can create RAR files. To change a CBR (add metadata, fix page order), read it with one of these libraries and write a CBZ. Check whether a library reads RAR5 (WinRAR 5+ default) as well as the older RAR4. For general RAR information see the RAR page.

Language Library Read Write Notes
C/C++ UnRAR yes no RARLAB reference code; freeware license, not OSI
C/C++ libarchive yes no RAR4 and RAR5, same API as ZIP/7z/TAR
C# SharpCompress yes no pure managed, RAR4 and RAR5
Java junrar yes no pure Java, RAR4 only (no RAR5); UnRAR license
Go rardecode yes no pure Go, RAR4 and RAR5, fs.FS
Go archives yes no mholt/archives: one API for RAR, ZIP, 7z, TAR
Python rarfile yes no zipfile-like API; needs the unrar tool
Python comicbox yes converts to CBZ comic-specific metadata, pages, covers
Ruby ffi-libarchive yes no libarchive binding
Rust unrar yes no binding to RARLAB UnRAR
Rust compress-tools yes no libarchive binding

PHP has no maintained open-source RAR reader: the PECL rar extension had its last release in 2020. Convert CBR to CBZ with a command-line tool and use ZipArchive.

By language#