Kindlegen guide: amazon's official ebook converter (still useful in 2026)

KindleGen is Amazon’s official command-line ebook converter. Though discontinued, it remains essential for professional ebook creation.

What is KindleGen?

KindleGen converts HTML, XHTML, and OPF files into Kindle-compatible MOBI/AZW3 format. It was Amazon’s recommended tool for years and still produces the most standards-compliant output.

Important: Amazon stopped providing KindleGen downloads in 2023. The last version is 2.9. You can still find it archived online or extract it from Kindle Previewer.

Why Still Use KindleGen?

ReasonExplanation
Standards complianceProduces Amazon’s most compatible MOBI files
Precise controlYou control every aspect of the output
Batch processingCan script conversions for many books
No GUI neededPerfect for automation and CI/CD
Lightweight10MB vs 400MB+ for Kindle Previewer

How to Get KindleGen

Since Amazon removed official downloads:

  1. Install Kindle Previewer (the newest version)
  2. Navigate to the installation folder:
    • Windows: C:\Program Files\Kindle Previewer 3\lib\kindlegen\
    • macOS: /Applications/Kindle Previewer 3.app/Contents/MacOS/lib/kindlegen/
  3. You’ll find the kindlegen executable there

Basic Usage

Command Line

kindlegen mybook.opf

This generates mybook.mobi in the same folder.

Common Options

kindlegen mybook.opf -o output.mobi    # Specify output filename
kindlegen mybook.opf -verbose          # Detailed output
kindlegen mybook.opf -c1               # Compression level (0-2)
kindlegen mybook.opf -gif              # Convert GIFs to PNGs
kindlegen mybook.opf -locale en        # Set language

Complete Workflow

Step 1: Prepare Your Files

Create an OPF package file and your HTML content:

mybook/
├── content.opf        # Metadata and manifest
├── toc.ncx            # Table of contents
├── chapter-01.html    # Chapter 1
├── chapter-02.html    # Chapter 2
├── styles.css         # CSS styles
└── images/
    ├── cover.jpg
    └── image1.jpg

Step 2: Create OPF File

<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://www.idpf.org/2007/opf" version="2.0" unique-identifier="BookId">
  <metadata>
    <dc:title>My Book Title</dc:title>
    <dc:creator>Author Name</dc:creator>
    <dc:language>en</dc:language>
    <dc:identifier id="BookId">978-0-000-00000-0</dc:identifier>
  </metadata>
  <manifest>
    <item id="cover" href="images/cover.jpg" media-type="image/jpeg"/>
    <item id="chapter1" href="chapter-01.html" media-type="application/xhtml+xml"/>
    <item id="chapter2" href="chapter-02.html" media-type="application/xhtml+xml"/>
    <item id="css" href="styles.css" media-type="text/css"/>
    <item id="ncx" href="toc.ncx" media-type="application/x-dtbncx+xml"/>
  </manifest>
  <spine toc="ncx">
    <itemref id="cover" linear="no"/>
    <itemref id="chapter1"/>
    <itemref id="chapter2"/>
  </spine>
</package>

Step 3: Run KindleGen

kindlegen content.opf -verbose -c1

Step 4: Test the Output

  1. Open the generated .mobi file in Kindle Previewer
  2. Check formatting on multiple device simulations
  3. Verify table of contents links

KindleGen vs Modern Tools

FeatureKindleGenKindle PreviewerCalibre
Format supportHTML → MOBI/AZWEPUB → KFX20+ formats
Quality★★★★★★★★★★★★★
Ease of use★★ (command line)★★★★ (GUI)★★★★★ (GUI)
Automation✅ Excellent❌ No⚠️ Limited
Output formatMOBI, AZW3KFXMOBI, AZW3, EPUB

Pro Tips

  • Use -c1 compression — best balance of size and quality
  • Validate with EpubCheck before running KindleGen
  • For KFX output, use Kindle Previewer instead (KindleGen doesn’t support KFX)
  • Batch convert with a shell script:
    for f in *.opf; do
      kindlegen "$f" -c1
    done
  • The 64-bit version (extracted from Kindle Previewer) works better on modern systems

Limitations

  • Discontinued — no new features or bug fixes
  • Only outputs MOBI/AZW3 (not KFX)
  • Doesn’t support EPUB3 features
  • Command-line only (no GUI)
  • Doesn’t validate EPUB input
Advertisement
Ad