MOBI Converter
Enterprise-grade client-side MOBI generator. Convert HTML/Text to Kindle format with PalmDOC compression, custom metadata, and cover art injection.
About
This is not a wrapper. This is a full-scale binary compiler for the Mobipocket file format, running entirely in your browser. Unlike generic converters that rely on server-side scripts (exposing your intellectual property), this tool constructs the Palm Database (PDB) structure bit-by-bit locally.
We solve the specific fragmentation problem of the e-Reader ecosystem. While the industry moves to EPUB, millions of robust, functional E-Ink devices (Kindle 3, 4, Voyage, Oasis) still rely on the legacy MOBI standard. The challenge is not just wrapping text; it is managing the PalmDOC compression (LZ77) to ensure large manuscripts fit on devices with limited storage, and correctly calculating the EXTH Headers so that cover art appears on the lock screen - a notorious failure point in open-source tools.
This engine implements the MOBI 6 standard, ensuring backward compatibility while utilizing modern high-density cover images. It handles the record offset calculations, bitwise attribute flags, and text encoding normalization automatically.
Formulas
The core of the MOBI format is the Record List Offset calculation. The file is a sequence of headers followed by a list of pointers to data chunks. The offset O for the i-th record is defined as:
Where N is the total number of records, 8 is the size of a record entry (4 bytes offset + 4 bytes attributes), and 2 is the gap padding.
PalmDOC Compression Efficiency:
The compression ratio η is determined by the frequency of repeated substrings. A length-distance pair <L, D> replaces a string if:
If the overhead of the pair (2 bytes) is less than the length of the string L, compression occurs.
Reference Data
| Technical Parameter | Standard MOBI (Legacy) | This Converter (Engine v2.0) | Kindle Limit (Ref) |
|---|---|---|---|
| Container Format | Palm Database (PDB) | PDB + MOBI Header v6 | N/A |
| Compression Algo | None / PalmDOC | Adaptive PalmDOC (LZ77) | Slow Decompression |
| Record Size | Variable | 4096 Bytes (Fixed) | Max 4096 |
| Max Text Size | Unbounded | 20 MB (Browser Safe) | Device RAM |
| Cover Image | Embedded in Text | EXTH Record 201 | 127 KB |
| Character Encoding | ASCII / Latin-1 | UTF-8 (65001) | UTF-8 |
| Navigation (NCX) | Manual Inline | Regex Heuristics | XML / NCX |
| Header Overhead | ~80 Bytes | ~300 Bytes (Rich Meta) | Flexible |