Kindleunpack: extract and modify kindle ebook files

KindleUnpack lets you open any Kindle ebook and extract its source files. Essential for fixing broken ebooks or learning how they’re built.

What is KindleUnpack?

KindleUnpack (originally mobiunpack) is a Python tool that extracts Kindle format files (MOBI, AZW3, PRC) into their component parts:

  • HTML/XHTML — the book’s content
  • CSS — styling
  • Images — covers and illustrations
  • NCX/TOC — table of contents
  • OPF — metadata
  • Fonts — embedded fonts

Download

VersionPlatformDownload Source
GUI (pyw)WindowsMobileRead
Calibre pluginCross-platformMobileRead
Python scriptCross-platformGitHub

How to Install

Python Script (Cross-Platform)

  1. Install Python 3.x
  2. Download KindleUnpack.py
  3. Run from command line

Calibre Plugin (Easiest)

  1. Open CalibrePreferences → Plugins
  2. Click Load plugin from file
  3. Select the downloaded .zip plugin
  4. Restart Calibre
  5. Now in Calibre: right-click a book → Unpack AZW3/MOBI

Windows GUI Version

  1. Download the .pyw file
  2. Double-click to run
  3. Select your MOBI/AZW3 file
  4. Click Unpack

Basic Usage

Command Line

python KindleUnpack.py input.mobi output_folder/

This extracts all files into output_folder/.

Calibre Plugin

  1. In Calibre, select a book
  2. Right-click → Unpack AZW3/MOBI
  3. Choose output directory
  4. Files are extracted for editing

What You Get

After unpacking, you’ll see:

output_folder/
├── mobi7/                 # Old MOBI format version
│   ├── book.html
│   └── images/
├── mobi8/                 # KF8/AZW3 format version
│   ├── book.html
│   ├── styles.css
│   └── images/
├── raw/                   # Raw binary data
├── metadata.opf           # Book metadata
├── toc.ncx                # Table of contents
└── cover.jpg              # Cover image

Common Use Cases

1. Fix a Broken Ebook

  1. KindleUnpack the broken file
  2. Fix the HTML/CSS in a text editor
  3. Rebuild with KindleGen or Calibre

2. Extract Images

Get high-resolution images from any Kindle book:

  1. Unpack the file
  2. Navigate to the images/ folder
  3. Copy the images you need

3. Study Ebook Structure

Learn how professional ebooks are structured:

  1. Unpack a well-formatted book
  2. Study the CSS and HTML
  3. Apply similar techniques to your own books

4. Convert AZW3 to MOBI

  1. Unpack AZW3 to source files
  2. Remove KF8-specific features
  3. Repackage with KindleGen as MOBI

Troubleshooting

ProblemSolution
”Not a valid Kindle file”File may be DRM-protected — KindleUnpack can’t remove DRM
Missing imagesCheck mobi8/images/ subfolder
Garbled HTMLTry the mobi7/ version instead of mobi8/
Script errorsUpdate to latest Python 3.x version
Calibre plugin not showingInstall from .zip file, not extracted folder

Limitations

  • Cannot remove DRM — only works on DRM-free files
  • KFX support is limited — newer Kindle formats may not unpack fully
  • Output quality varies — some source files are minified or obfuscated
  • Command-line only (the GUI version is basic)
Advertisement
Ad