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, adds folder context menu options for recursive directory conversions, creates a Send to shortcut (
Send to -> Hammer down) for first-level access in Windows 11, and activates an IPC coordinator to process multi-file selections in a single terminal window - on Linux: installs the launcher into
~/.local/bin, installs a FreeDesktop application entry in~/.local/share/applications/hammerdown.desktopwith MIME associations, registers KDE Dolphin ServiceMenus in~/.local/share/kio/servicemenusand~/.local/share/kservices5/ServiceMenus, and adds scripts for Nautilus, Nemo, and Caja (Scripts -> Hammer down file) - on macOS: installs the launcher into
~/.local/bin, creates an Automator Quick Action in~/Library/Services/Hammer down.workflowfor the Finder right-click context menu, and generates a drag-and-drop Droplet in~/Applications/Hammer down.appwithCFBundleDocumentTypesfor Finder "Open With"
To convert a file or folder, right-click any supported document or folder and select Hammer down file (or use Send to -> Hammer down). The Markdown output and extracted images are saved directly next to each 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-w,--overwrite-- overwrite plain-text source files (.txt,.md,.log,.csv) in-place instead of creating a copy-s,--skip-existing-- skip conversion if target Markdown file already exists (overwriting is enabled by default)-m,--merge OUTPUT_MD-- merge all converted Markdown documents into a single target Markdown file-q,--quiet-- suppress routine status output-v,--version-- display version information
hammerdown -i document.pdf
hammerdown -s document.pdf
hammerdown -m summary.md file1.pdf file2.docx
hammerdown folder/
Logging and Progress Tracking
When converting documents from the terminal, hammerdown displays an interactive real-time progress bar indicating the exact progress (e.g., page, slide, or sheet counts):
Processing document.pdf: [████████████░░░░░░░░] 60% (30/50 pages)
Completed document.pdf in 1.4s (3 images extracted)
In non-interactive environments (CI/CD pipelines, redirected log files, or non-TTY outputs), progress is logged as periodic status lines starting from 0% without terminal control characters:
[hammerdown] Processing document.pdf (50 pages, est. ~45s)...
[hammerdown] Processing document.pdf: 0/50 pages (0%)...
[hammerdown] Processing document.pdf: 1/50 pages (2%)...
...
[hammerdown] Processing document.pdf: 50/50 pages (100%)...
[hammerdown] Completed document.pdf in 1.4s (3 images extracted)
When using hammerdown as a Python library, custom progress callbacks can be passed to to_markdown() or convert_file():
def on_progress(current: int, total: int, unit: str):
print(f"Processed {current}/{total} {unit}")
hammerdown.convert_file("document.pdf", progress_callback=on_progress)
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 hm_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", skip_existing=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 hm_<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
├── hm_document_pdf.md
└── hm_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
- Performance & Estimation Model -- conversion benchmarks, multi-threading architecture, and ETA model
- Contributing Guidelines -- development setup and testing guidelines
Metadata
Release files for hammerdown 2.0.1
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-2.0.1.tar.gz | 222.4 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hammerdown-2.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 435.7 kB
Release files / hammerdown-2.0.1.tar.gz
| Download URL | hammerdown-2.0.1.tar.gz |
|---|---|
| Size | 222.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fbe763336f1589b2a17f35192a731fa1c822682b5ba987f2a23796d155345276
|
|
BLAKE2b-256 checksum How to use checksums |
5cdbe935b49c09305c2cedc5822bd336251767fba142e653ec073b02da567ee3
|
| 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 11, 2026.
Transparency logRelease files / hammerdown-2.0.1-py3-none-any.whl
| Download URL | hammerdown-2.0.1-py3-none-any.whl |
|---|---|
| Size | 213.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6f0bda66a0c4809a1d8ea5e9afc7c3f7f83f990d7ecc76ba5b2bb00c8edf2dc0
|
|
BLAKE2b-256 checksum How to use checksums |
11693d5ef05c2ec215959c5907a02432aa375a5ff6c83ada52a2683e52e037b9
|
| 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 11, 2026.
Transparency logSecurity for hammerdown 2.0.1
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-2.0.1.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 11, 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.