pptx-to-html5
December 14, 2025 ยท View on GitHub
A Python tool for converting PowerPoint presentations (.pptx) to interactive HTML5 websites with accurate positioning.
Features
- ๐จ Convert PowerPoint presentations to standalone HTML5 websites
- ๐ Accurate element positioning - Preserves the layout and positioning of text boxes, images, and other elements from your slides
- ๐ฑ Responsive design that works on desktop and mobile devices
- โจ๏ธ Keyboard navigation (arrow keys, space, Home, End)
- ๐ Touch/swipe support for mobile devices
- ๐ Optional speaker notes inclusion
- ๐ฏ Clean, modern UI with smooth transitions
- ๐ Progress bar and slide counter
- ๐ป Command-line interface for easy automation
- ๐ Bullet point support - Multi-level bullets with proper indentation
How It Works
The converter extracts individual shapes (text boxes, images, etc.) from your PowerPoint slides along with their exact positions, sizes, and formatting. These are then rendered as positioned HTML elements, maintaining the original slide layout.
- Text elements: Preserved with font size, style (bold/italic), and alignment
- Bullet points: Multi-level bullets (โข, โฆ, โช) with proper indentation based on paragraph level
- Images: Embedded as base64-encoded data URIs with automatic format detection
- Positioning: Converted to percentage-based CSS positioning for responsive scaling
Requirements
- Python 3.12 or higher
- Dependencies: python-pptx, Pillow, Jinja2
Installation
From PyPI (recommended)
pip install pptx-to-html5
From source
git clone https://github.com/shafe123/pptx-to-html5.git
cd pptx-to-html5
pip install -e .
Development installation
pip install -e ".[dev]"
Usage
Command Line
Convert a PowerPoint presentation to HTML5:
pptx-to-html presentation.pptx
Specify an output directory:
pptx-to-html presentation.pptx -o output_folder
Include speaker notes in the output:
pptx-to-html presentation.pptx --include-notes
Python API
from pptx_to_html5.converter import PowerPointToHTML5Converter
# Create converter
converter = PowerPointToHTML5Converter("presentation.pptx")
# Convert to HTML5
output_path = converter.convert("output_folder", include_notes=False)
print(f"Presentation converted to: {output_path}")
Output Structure
The converter creates a self-contained website with:
index.html- Main presentation filestyles.css- Styling and layoutscript.js- Navigation and interactivity
Simply open index.html in any modern web browser to view the presentation.
Navigation Controls
- Arrow Keys (โ โ): Navigate between slides
- Space Bar: Next slide
- Home: Go to first slide
- End: Go to last slide
- Mouse/Touch: Use on-screen buttons or swipe gestures
Development
Running Tests
pytest
Code Quality
The project follows PEP8 style guidelines and uses type hints throughout.
Run linting:
ruff check src/
Run type checking:
mypy src/
License
This is free and unencumbered software released into the public domain - see LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.