2ClickKit

MOBI to EPUB Converter

Files Never Leave Your Device

Convert legacy Mobipocket (.mobi, .prc) files into standard, reflowable EPUB 3 publications with automatic chapter spine synthesis.

Drop your Kindle MOBI eBook here or click to browse

100% in-browser processing. Converts MOBI / PRC into standard EPUB (.epub).

Technical Architecture: Decompressing PalmDOC & Synthesizing EPUB 3

The conversion from Mobipocket (MOBI) to Electronic Publication (EPUB 3) represents the reverse engineering of one of the digital publishing industry's earliest mobile binary container formats. While modern publishing relies on modular, semantic XHTML containers, MOBI originated in the year 2000 as an extension of the Palm OS Palm Database (PDB) format.

To transform a binary MOBI file into an interoperable EPUB that renders seamlessly on Kobo, Apple Books, and Android readers, 2ClickKit executes a multi-tiered decoding and compilation pipeline entirely in the client browser.

Phase 1: Palm Database Container Parsing

The engine first deserializes the 78-byte Palm Database header and the subsequent record offset table:

  1. Header Verification: Validates database type ('BOOK') and creator FourCC code ('MOBI').
  2. Record Offset Mapping: Extracts offsets for all records stored in the file to establish memory boundaries for text chunks and embedded media.
  3. Record 0 Inspection: Reads the PalmDOC compression mode (Type 1 for uncompressed, Type 2 for PalmDOC LZ77) and extracts the MOBI header length, text encoding (UTF-8 vs CP1252), and EXTH metadata records.

Phase 2: PalmDOC LZ77 Decompression Mechanics

When a MOBI file utilizes PalmDOC LZ77 compression, text data is stored in dense 4,096-byte blocks. The in-browser decompressor iterates through each byte according to the following mathematical rules:

Byte Range (Hex) Classification Decompression Operation
0x00 Literal Null Outputs literal null byte 0x00.
0x01 - 0x08 Literal Sequence Reads the following N bytes directly into the output stream without modification.
0x09 - 0x7F Single ASCII Character Outputs the byte value directly as a character token.
0x80 - 0xBF Distance / Length Pointer Reads next byte b1. Distance = ((b0 & 0x03) << 8) | b1. Length = ((b0 >> 2) & 0x07) + 3. Copies length bytes from distance positions backwards in the buffer.
0xC0 - 0xFF Space + Character Pair Outputs an ASCII space (0x20) followed by the character code b0 ^ 0x80.

Phase 3: Chapter Detection & XHTML Spine Assembly

Once all text records are decompressed and joined into a unified HTML document, the engine analyzes the structure to divide the single monolithic stream into modular chapters:

  • Kindle Page Breaks: Scans for <mbp:pagebreak/> tags and CSS page-break properties.
  • Heading Hierarchy: Detects <h1>, <h2>, and <title> elements to assign meaningful chapter titles.
  • XML Well-Formedness: Wraps each section into a valid, standalone XHTML document adhering to XML namespace requirements (xmlns="http://www.w3.org/1999/xhtml").

Phase 4: EPUB 3 Packaging & Dual Navigation

An interoperable EPUB requires strict conformance to IDPF and W3C specifications:

Package File Standard Specification Function in Reading Systems
mimetype Stored (Zero Compression) Identifies the file as application/epub+zip for operating system file type detection.
META-INF/container.xml Open Container Format (OCF) Points reading applications to the primary package manifest at OEBPS/content.opf.
OEBPS/nav.xhtml EPUB 3 Navigation Document Semantic HTML5 <nav epub:type="toc"> list for modern e-readers.
OEBPS/toc.ncx EPUB 2 NCX Specification Hierarchical XML navigation tree for older hardware e-readers and legacy software.
OEBPS/content.opf Package Document Catalogs manifest items, metadata Dublin Core tags, and linear reading spine order.

Why Client-Side In-Browser Conversion Is Superior

Privacy is the defining feature of 2ClickKit. Traditional conversion sites force users to transmit unreleased manuscripts, sensitive corporate training books, or personal digital diaries across public networks to cloud servers.

  • Zero Server Storage: Your eBook never touches an external disk, eliminating data leaks and intellectual property theft.
  • No Cloud Bandwidth Lag: Processing occurs locally at gigabyte-per-second memory speeds.
  • Full Offline Support: Once the webpage assets are cached in your browser, the tool operates seamlessly without an active internet connection.

Developer Code Example: Decompressing PalmDOC in JavaScript

// Client-side implementation of PalmDOC LZ77 decompressor
function decompressPalmDocBlock(data) {
  const output = [];
  let i = 0;
  const len = data.length;

  while (i < len) {
    const b0 = data[i++];
    if (b0 === 0x00) {
      output.push(0x00);
    } else if (b0 >= 0x01 && b0 <= 0x08) {
      for (let j = 0; j < b0 && i < len; j++) output.push(data[i++]);
    } else if (b0 >= 0x09 && b0 <= 0x7f) {
      output.push(b0);
    } else if (b0 >= 0x80 && b0 <= 0xbf) {
      if (i >= len) break;
      const b1 = data[i++];
      const distance = ((b0 & 0x03) << 8) | b1;
      const length = ((b0 >> 2) & 0x07) + 3;
      const start = output.length - distance;
      for (let j = 0; j < length; j++) {
        output.push(output[start + j] || 0x20);
      }
    } else if (b0 >= 0xc0) {
      output.push(0x20);
      output.push(b0 ^ 0x80);
    }
  }

  return new Uint8Array(output);
}

Tips for Optimal Reading Quality

  • Check Table of Contents: Open the EPUB in Apple Books or Calibre and click the Table of Contents button to verify all chapter breaks are correctly indexed.
  • Cross-Platform Transfer: To read your newly converted EPUB on Kobo, connect your e-reader via USB and drag the file directly into the main storage folder.

How to Use MOBI to EPUB Converter

  1. Select MOBI or PRC File

    Upload or drag and drop any .mobi or .prc Kindle eBook file into the secure drop zone.

  2. Review Extracted Chapters

    The client-side engine decompresses PalmDOC records, extracts metadata, and maps chapters automatically.

  3. Download Standard EPUB

    Click "Convert to Standard EPUB" to synthesize a compliant EPUB 3 archive ready for Apple Books, Kobo, and Android.

Classic Novel MOBI to EPUB Conversion

Source Kindle MOBI eBook
Sherlock-Holmes-Doyle.mobi (420 KB, 12 chapters)
Converted EPUB Publication
Sherlock_Holmes.epub (380 KB, EPUB 3 + NCX dual navigation)

Decompressed and packaged in 920ms with 100% private in-browser execution.

Technical Specifications

  • Supported Inputs: Mobipocket Kindle (.mobi, .prc), EPUB 3 (.epub)
  • Input Limit: Unlimited (100% In-Browser Memory)
  • Processing Engine: 100% In-Browser (PalmDOC LZ77 Decoder + EPUB 3 Synthesizer)
  • Content Uploads: None (Your files and text are processed locally on your device with zero uploads)

Privacy & Security Guarantee

Your Kindle eBooks, personal manuscripts, and classic literature are processed entirely in your web browser's memory using native client-side web technologies. Unlike traditional cloud tools, your content is never uploaded to remote servers, stored on external disks, or analyzed by third parties.

2ClickKit In-Browser vs Traditional Cloud Tools

Feature 2ClickKit (In-Browser) Traditional Cloud Services
Data Privacy Files never leave your local device Uploaded to remote servers and third-party clouds
Processing Speed Instant local execution (0ms upload time) Constrained by internet upload & server processing queues
Account & Costs 100% Free with zero registration or paywalls Tiered subscriptions, limits, or forced sign-ups

Best Practices & Tips

  • Inspect the detected chapters list before converting to confirm the internal section dividers and chapter counts look accurate.
  • If you plan to read the EPUB in Apple Books on Mac or iPad, simply AirDrop or double-click the downloaded .epub file to add it directly to your library.
  • Make sure your source file is not encrypted with Kindle DRM prior to uploading.

Frequently Asked Questions

Why convert MOBI eBooks to EPUB format?

MOBI is a proprietary legacy format developed for older Kindle devices. EPUB is the international open standard supported across Apple Books, Kobo e-readers, Nook, Google Play Books, and Android reading applications. Converting MOBI to EPUB unlocks your library across all non-Amazon devices.

Does this converter preserve images and formatting?

Yes. The decompression engine extracts embedded JPEG and PNG images from trailing Palm Database records and relinks them within the clean XHTML chapter spine, preserving formatting and illustrations.

How does 2ClickKit ensure privacy when converting my eBooks?

All extraction and repackaging runs 100% locally in your web browser using HTML5 binary buffers and JSZip. Zero bytes of text, illustrations, or metadata are ever transmitted to any external server.

Can I convert DRM-locked MOBI files downloaded from Amazon?

No. Files protected by Amazon proprietary Kindle DRM encryption must have DRM removed in authorized reading software before conversion. 2ClickKit converts standard, non-DRM MOBI and PalmDOC files.

What is PalmDOC LZ77 compression and how is it unpacked?

PalmDOC LZ77 is a historical sliding-window compression format. Our in-browser decoder interprets byte sequences, distance-length match pointers, and space-character run pairs directly in memory to produce raw UTF-8 HTML.

Will the generated EPUB open on iPad and iPhone Apple Books?

Yes. The resulting EPUB contains both EPUB 3 navigation (nav.xhtml) and EPUB 2 backward-compatible navigation (toc.ncx), rendering flawlessly on Apple Books, Thorium Reader, and Calibre.

Can I convert large MOBI books with hundreds of pages?

Yes. There are no server upload limits or queue wait times. You can convert books of any length, limited solely by your local device RAM.