hammerdown
hammerdown is a cross-platform tool and Python library for converting PDF, Word, Excel, PowerPoint, OpenDocument, CSV, and plain-text documents into clean Markdown. Embedded images, SVG charts, and mathematical formulas are automatically extracted and formatted.
Table of Contents
- Installation
- Usage
- Supported Formats
- Output Directory Layout
- Math Formulas and Symbol Normalization
- Documentation links
Installation
Recommended: Python package (pip)
If Python (3.10+) is installed on your system, install via pip:
pip install hammerdown
Or install from local source:
git clone https://github.com/sergeypugin/hammerdown.git
cd hammerdown
pip install .
Direct Download (Standalone binaries)
If you do not have Python installed, precompiled standalone binaries are available on the GitHub Releases page or you can download directly from the links below:
| OS | Download |
|---|---|
| Windows | |
| Linux | |
| macOS |
On Linux and macOS, make the downloaded binary executable before running:
chmod +x ./hammerdown-linux-x64
./hammerdown-linux-x64 --version
File Manager Context Menu Integration
You can integrate hammerdown directly into your OS file manager to convert documents with a single right-click, without opening a terminal:
hammerdown --install
What this does:
- on Windows: adds a Hammer down file action with an icon to the File Explorer context menu for all supported document formats (no administrator privileges required)
- on Linux: installs the executable into
~/.local/binand adds a context script for GNOME Nautilus (Scripts -> Hammer down file)
To convert a file, right-click any supported document (.pdf, .docx, etc.) and select Hammer down file. The Markdown output and extracted images are saved directly next to the original document.
To remove file manager integration and clean up shortcuts:
hammerdown --uninstall
To update hammerdown to the latest version:
hammerdown --update
Usage
Command Line Interface
Convert one or multiple files:
hammerdown document.pdf
hammerdown report.docx workbook.xlsx slides.pptx
Options:
-i,--in-place-- save output Markdown and extracted images in the same directory as the source file-f,--force-- overwrite existing output Markdown files-q,--quiet-- suppress routine status output-v,--version-- display version information
hammerdown -i document.pdf
hammerdown -f report.docx
Extracting Base64 Images from Markdown
If you have a Markdown file with embedded base64 images (such as data:image/png;base64,...), running hammerdown with --in-place will extract those raw image strings into PNG or JPEG files inside hammerdown_images_<stem>_<ext>/ and replace inline base64 data URIs with clean relative links:
hammerdown document.md --in-place
Python Library Quickstart
Use hammerdown directly in your Python code:
import hammerdown
# Convert a file on disk
hammerdown.convert_file("document.pdf", force=True)
# Get Markdown text in memory
text, image_count = hammerdown.to_markdown("report.docx")
For specialized format converters and low-level helpers, see docs/PYTHON.md.
Supported Formats
- PDF and E-books:
.pdf,.epub,.mobi,.fb2,.xps - Word and OpenDocument:
.docx,.doc,.odt - Spreadsheets:
.xlsx,.xls,.csv - Presentations:
.pptx,.ppt - Text and Markdown:
.txt,.md,.log
Output Directory Layout
Output Markdown files are saved using the template <stem>_<ext>.md to avoid conflicts when files of different formats share the same base name.
Before conversion:
folder/
└── document.pdf
After conversion:
folder/
├── document.pdf
├── document_pdf.md
└── hammerdown_images_document_pdf/
└── img_p001_xref105.png
Math Formulas and Symbol Normalization
Equations inside Word and OpenDocument files are automatically translated into standard LaTeX syntax. Special math characters and Greek letters are mapped using a catalog aligned with official LaTeX references:
- Official Reference: Rice University LaTeX Symbols Reference
- Bundled Copy: symbols.pdf
Documentation links
For additional guides and specifications:
- Python API Reference -- complete guide to Python library methods
- Technical Reference -- internal format processing and parser details
- Architecture -- system layers and Mermaid pipeline diagram
- Conversion Benchmarks & Estimations -- empirical performance tables and ETA model
- Contributing Guidelines -- development setup and testing guidelines
Metadata
Release files for hammerdown 1.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| hammerdown-1.3.2.tar.gz | 99.2 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hammerdown-1.3.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 193.7 kB
Release files / hammerdown-1.3.2.tar.gz
| Download URL | hammerdown-1.3.2.tar.gz |
|---|---|
| Size | 99.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a623ffdadf1057b78fa4d7e1990a641d58fecbf40091946be7f7431359315b28
|
|
BLAKE2b-256 checksum How to use checksums |
ee847dc2739e11f681b7c7fc6d4da1dcc33749718a870f6d38c9fa2d4ab31d95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.
Transparency logRelease files / hammerdown-1.3.2-py3-none-any.whl
| Download URL | hammerdown-1.3.2-py3-none-any.whl |
|---|---|
| Size | 94.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d99449fea77d888ddb36fe232a205fb595194e20aba0ecb6e107b21509af0277
|
|
BLAKE2b-256 checksum How to use checksums |
c475f3a8b08d91ee0438bd48cbac8c177e833f7c34641ac9c919b008bd3c4f47
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.
Transparency logSecurity for hammerdown 1.3.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for hammerdown-1.3.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.