xls2xlsx
Convert xls file to xlsx
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 xls2xlsxuv
uv add xls2xlsxpoetry
poetry add xls2xlsxInstalling 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
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
ssfFormats numbers and dates using ECMA-376…
permissive · top 5,000 on PyPI
xlrdxlrd reads data and formatting information from…
permissive · top 1,000 on PyPI
xlsx2htmlConverts Excel spreadsheets (.xlsx files) to…
permissive · top 15,000 on PyPI
excelrdExtracts data from Microsoft Excel spreadsheet…
permissive · top 15,000 on PyPI
drf-excelAdds an Excel spreadsheet (xlsx) renderer to…
permissive · top 15,000 on PyPI
aspose-cellsAspose.Cells for Python via Java is a library…
unclear · top 15,000 on PyPI
xlrd3Reads data from Excel spreadsheet files (.xls…
permissive · top 15,000 on PyPI
aspose-cells-pythonAspose.Cells for Python via .NET creates,…
unclear · top 15,000 on PyPI
openpyxlopenpyxl reads and writes Excel 2010…
permissive · top 1,000 on PyPI
openpyxl-stubsProvides type stubs for openpyxl to enable…
permissive · top 15,000 on PyPI