skillfed

xls2xlsx

Convert xls file to xlsx

xls2xlsx v0.2.0 2.0M downloads/30d#3,374 on PyPI63
Permissive license MIT license DORMANT released

What it is and what it does

xls2xlsx is a command-line and Python library tool that converts three input formats—Excel 97-2003 workbooks (.xls), HTML web pages (.htm), and single-file web archives (.mht)—into Excel format (.xlsx). It preserves a wide range of formatting: text styles (bold, italic, underline, strikeout), cell colors and fills, borders, alignment, number formats including currency symbols, merged cells, hyperlinks, comments, and hidden rows/columns. It handles multiple worksheets and Unicode content.

The package has significant limitations: it does not preserve formulas (only their calculated values), conditional formatting, charts, drawings, pivot tables, or VBA macros. For .htm/.mht input, it converts images and text boxes to images but cannot handle shapes or clip art. The conversion relies on xlrd and openpyxl for .xls files and beautifulsoup4 with Pillow for HTML content. Font measurement for HTML input uses Pillow's ImageFont and falls back to estimation when system fonts are unavailable.

Use it for:

  • Migrate legacy .xls files to .xlsx format for compatibility with modern Excel versions and cloud tools.
  • Batch-convert HTML tables from web pages or exported reports into structured Excel workbooks.
  • Extract and preserve formatted data from .mht (single-file web archive) documents into Excel.
  • Automate spreadsheet format conversion in data pipelines where formulas and advanced features are not required.
  • Convert historical Excel data with preserved styling (fonts, colors, borders) without manual re-entry.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Converts legacy Excel files (.xls), HTML tables, and single-file web pages (.mht) to modern Excel format (.xlsx), preserving formatting, styles, and basic structure.

Yes, if you need to convert .xls, .htm, or .mht files to .xlsx and can accept that formulas, charts, and advanced Excel features will not be preserved. The low install friction and permissive license make it a straightforward choice for one-off or batch conversions. The dormant maintenance status is acceptable for a stable, narrowly-scoped tool with no known vulnerabilities, but do not expect active bug fixes or feature development.

Install

xls2xlsx on PyPI

pip

pip install xls2xlsx

uv

uv add xls2xlsx

poetry

poetry add xls2xlsx

Installing xls2xlsx

Before you install

Low friction: pure Python wheel with no compiled dependencies. Maintenance is dormant (1316 days since last release in January 2023), though the repository remains active with a recent commit in April 2024. Suitable for stable, one-off conversion tasks but not for packages expecting ongoing updates.

License in practice

MIT license (permissive) places no restrictions on use, modification, or redistribution in commercial or private projects.

Quickstart

pip install xls2xlsx

from xls2xlsx import XLS2XLSX
x2x = XLS2XLSX("spreadsheet.xls")
x2x.to_xlsx("spreadsheet.xlsx")

Requires Python >= 3.7. For .htm/.mht input, Pillow's font detection may fall back to estimation if system fonts are unavailable.

Verify before relying

  • Whether the 12 runtime dependencies are all actively maintained.
  • Performance characteristics with large files or batch conversions.
  • Accuracy of font size estimation when system fonts are missing.
  • Excel version compatibility of the output .xlsx files.

Package facts

License MIT license (permissive)
Python support supports the current Python release (>=3.7)
Install friction low — pure-Python wheel
Runtime dependencies 12 — xlrd, openpyxl, requests, beautifulsoup4, Pillow, python-dateutil, cssutils, webcolors, currency-symbols, chardet, fonttools, PyYAML
Maintenance dormant — 1,316 days since the last release
Last repo commit
First released
Downloads 2,000,327/month — #3,374 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: xls2xlsx-0.2.0-py2.py3-none-any.whl

Keywords: xls2xlsx

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

xls to xlsx converterexcel file format conversionlegacy spreadsheet migrationhtml table to excelbatch xls conversion
file-conversionspreadsheet-tools

More Utilities packages