All formats

CHM libraries

All CHM libraries read files: they list the files inside a CHM and decompress them (LZX). None of them create CHM files; for that, Microsoft’s HTML Help Workshop compiler (hhc.exe) is the only practical tool. After extraction, the table of contents (.hhc) and index (.hhk) are ordinary HTML that you parse with any HTML parser.

Language Library Read Write Notes
C/C++ chmdec yes no cleaned-up, fuzzed port of CHMLib, one file, WebAssembly build, LGPL
C/C++ CHMLib yes no the classic C library behind most Linux CHM viewers, LGPL
C/C++ libmspack yes no robust CAB/CHM/LIT decompression library, LGPL
Python pychm yes no bindings to CHMLib, with topics tree and full-text search, GPL
Java jchmlib yes no pure Java, search and encoding detection, Apache-2.0, unmaintained since 2017
Rust libchm yes no pure Rust, no unsafe code, MIT
PHP chm-lib yes no pure PHP, parses TOC and index, MIT

There are no maintained CHM libraries for C#, Go or Ruby. From those languages, run 7z x file.chm or call CHMLib or libmspack through FFI.

By language#