Skip to main content

hammerdown

Tests PyPI GitHub Release Python Version Platform PRs Welcome

hammerdown logo

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

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 Windows x64
Linux Linux x64
macOS macOS x64 macOS ARM64

On Linux and macOS, make the downloaded binary executable before running:

chmod +x ./hammerdown-linux-x64
./hammerdown-linux-x64 --version

File Manager Context Menu

Register system context menu integration using --install:

hammerdown --install

To remove integration:

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:

For additional guides and specifications:

Metadata

Release files for hammerdown 1.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hammerdown 1.3.1
File Size Uploaded Provenance
hammerdown-1.3.1.tar.gz 98.1 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for hammerdown 1.3.1
File Interpreter ABI Platform
hammerdown-1.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 191.7 kB

Release files / hammerdown-1.3.1.tar.gz

Download URL hammerdown-1.3.1.tar.gz
Size 98.1 kB
Tags Source
SHA-256 checksum
How to use checksums
e5cd2a929ecfa46fc0e30a9cfd90b6f18eb7b1764d2b692126b42dee9d32f25e
BLAKE2b-256 checksum
How to use checksums
0e2aa2d6062fe7e6d62fa10abc5b3858c11543e4affb79740f051388ee036cb3
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 9, 2026.

Transparency log

Release files / hammerdown-1.3.1-py3-none-any.whl

Download URL hammerdown-1.3.1-py3-none-any.whl
Size 93.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
02624b3772f3991d937d11555ff7b5757437fa9202c062de2284c5a31830e126
BLAKE2b-256 checksum
How to use checksums
18c06480263a1b06ae11df2bec29baafdc926cfaea6b3e729d08392aebd3242f
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 9, 2026.

Transparency log

Security for hammerdown 1.3.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.

Select from 2 files

Attestation for hammerdown-1.3.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 9, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page