skillfed

xlsx2html

A simple export from xlsx format to html tables with keep cell formatting

xlsx2html v0.6.4 194.1K downloads/30d#9,845 on PyPI71
Permissive license MIT Active released

What it is and what it does

xlsx2html is a lightweight Python converter that reads Excel workbooks and outputs them as HTML tables. It wraps openpyxl for reading .xlsx files and uses babel for locale-aware formatting of numbers and dates. The package is designed for straightforward export scenarios where you need to turn spreadsheet data into web-viewable HTML while maintaining basic cell formatting.

The library supports multiple input/output modes: reading from file paths, working with file-like objects in memory, or running as a command-line tool. It's in Alpha status and actively maintained, supporting Python 3.6 through 3.14 and PyPy. With no known vulnerabilities and permissive MIT licensing, it's a low-risk choice for simple xlsx-to-html pipelines.

Use it for:

  • Export financial reports or data tables from Excel to embed in web dashboards or email templates.
  • Batch convert spreadsheet archives to HTML for archival or documentation purposes.
  • Generate HTML previews of uploaded Excel files in web applications without server-side rendering.
  • Automate spreadsheet-to-web workflows where cell formatting (alignment, number display) matters.
  • Convert locale-specific spreadsheets (e.g., European number formats) to correctly formatted HTML tables.

Worth the install?

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

Converts Excel spreadsheets (.xlsx files) to HTML tables while preserving cell formatting, with support for locale-specific number and date rendering.

Yes, if you need straightforward xlsx-to-HTML conversion with basic formatting preservation. Low install friction, active maintenance, MIT license, and no vulnerabilities make it safe. Best suited for simple export tasks; verify first whether its formatting support (colors, fonts, merged cells) meets your specific needs before relying on it for complex spreadsheets.

Install

xlsx2html on PyPI

pip

pip install xlsx2html

uv

uv add xlsx2html

poetry

poetry add xlsx2html

Installing xlsx2html

Before you install

Low friction: pure Python wheel with four common dependencies (six, openpyxl, babel, packaging). Last release 172 days ago with active repository maintenance and 71 GitHub stars.

License in practice

MIT license permits commercial and private use with minimal restrictions—include a copy of the license and you're clear.

Quickstart

pip install xlsx2html

from xlsx2html import xlsx2html

# Convert to stream
out_stream = xlsx2html('path/to/example.xlsx')
out_stream.seek(0)
html_output = out_stream.read()

# Or write directly to file
xlsx2html('path/to/example.xlsx', 'path/to/output.html')

Verify before relying

  • Whether cell formatting preservation includes colors, fonts, borders, or only basic alignment and number formats.
  • Performance characteristics when processing large spreadsheets (row/column limits, memory usage).
  • Support for merged cells, formulas, or other advanced Excel features.
  • Locale parameter behavior and which locales are supported beyond 'en'.

Package facts

License MIT (permissive)
Python support supports the current Python release (<4,>=3.6)
Install friction low — pure-Python wheel
Runtime dependencies 4 — six, openpyxl, babel, packaging
Maintenance actively maintained — 172 days since the last release
Last repo commit
First released
Downloads 194,139/month — #9,845 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: xlsx2html-0.6.4-py2.py3-none-any.whl

Keywords: converter, xlsx, html

Development Status :: 3 - AlphaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: PyPyTopic :: Text ProcessingTopic :: Text Processing :: Markup :: HTML

Tags

xlsx to html converterexcel spreadsheet html exportxlsx table conversionpreserve excel formatting htmlexcel to html with stylesbatch convert xlsx files
excel-conversiondata-export

More Text Processing packages