Skip to main content
TrimItDown

Any document → clean, LLM-ready Markdown. On your own server, on every device you own.

Read this in: English (this file) · русский

Latest release Downloads macOS build PyPI License: MIT Platforms

TrimItDown converting a PDF: live Markdown preview with a real table and a token counter

TrimItDown turns PDF, Word (docx), PowerPoint (pptx), Excel (xlsx/xls) and Outlook (.msg) files into clean, readable Markdown — ready to paste into Claude/ChatGPT, Obsidian, Notion, or any markdown vault. It runs as an iPhone/iPad app (installed straight from Safari, no App Store), a single-file Windows program, a macOS app, and a self-hosted Docker server — with one shared archive of conversions across all your devices.

The PDF engine

Most converters — including the stock MarkItDown PDF path — stumble on real-world PDFs in three measurable ways: they glue words together, invent tables out of ordinary prose, and drop genuine ruled tables. Measured over 891 real documents from two independent collections, the stock converter emitted 5,624 table rows on documents containing no ruled grid at all — prose reshaped into tables — against 2 from the engine below. On the 885 of those documents that are not broken at the source, it roughly halves glued words (107 runs vs 53). Those corpora are third-party copyrighted material and are not redistributable — the full method, the numbers, the cases where this engine loses, and what a reader can reproduce are in docs/pdf-engine.md.

So TrimItDown replaced it with a custom extraction engine:

  • Words split at a measured word-gap threshold — a fraction of the font size, not a fixed point value, so it holds across small print and large headings alike.
  • A dedicated table-detection stage validates every candidate grid by how its cells are actually filled (a row-fill vote), instead of trusting every ruled rectangle. Diagrams and decorative frames get rejected; their text flows back into prose instead of vanishing.
  • Genuine ruled tables render as honest Markdown tables, cell for cell.

Here is one document converted both ways. The file is committed to this repo, so you can run the comparison yourself:

python scripts/compare_pdf_engines.py tests/data/sample-service-report.pdf

Stock converter — a phantom empty column splits the data, shifting every value one column right of its header:

| Parameter                 | Unit | Before service |     | After service | Limit |
| ------------------------- | ---- | -------------- | --- | ------------- | ----- |
| Supply airflow            | m³/h |                | 352 | 398           | ≥ 380 |
| Extract airflow           | m³/h |                | 341 | 402           | ≥ 380 |
| Filter pressure drop      | Pa   |                | 184 | 92            | ≤ 150 |
| Heat recovery efficiency  | %    |                | 61  | 78            | ≥ 70  |
| Motor current, supply fan | A    |                | 1.9 | 1.6           | ≤ 2.2 |

TrimItDown — the table as it appears on the page:

| Parameter | Unit | Before service | After service | Limit |
| --- | --- | --- | --- | --- |
| Supply airflow | m³/h | 352 | 398 | ≥ 380 |
| Extract airflow | m³/h | 341 | 402 | ≥ 380 |
| Filter pressure drop | Pa | 184 | 92 | ≤ 150 |
| Heat recovery efficiency | % | 61 | 78 | ≥ 70 |
| Motor current, supply fan | A | 1.9 | 1.6 | ≤ 2.2 |

One sample proves nothing about a corpus, and ours is third-party material we cannot publish. So the measurement ships instead of the documents — point it at your own PDFs and it runs both converters over all of them and prints a comparable summary, counts only, no filenames:

python scripts/measure_corpus.py /path/to/your/pdfs --limit 50

Please send that summary back whatever it says — a win, a loss, or a tie (issue template). Results collected only when something breaks are a sample made of breakage, and nothing honest can be concluded from it. Pooled across enough corpora, these numbers stop being one person's collection. Details in docs/pdf-engine.md.

In short: we add the table-validation stage that the classic tabula-java pipeline has and Python extractors lack, expressed as a cell-fill vote on pdfplumber's ruled grids, with per-grid fallback to prose — no ML models, no cloud, small enough to ship inside a portable binary. Every non-PDF format still goes through MarkItDown.

Why TrimItDown

  • Made for the LLM workflow. Clean Markdown out, a live preview, and a token counter that shows what a document will cost before you paste it into a model's context.
  • Your files never leave your infrastructure. Conversion happens on your own server (home NAS, VPS) or fully offline on your computer. No third-party SaaS, no per-page fees.
  • One archive, every device. Convert on your phone — the result is already on your computer, and vice versa. Searchable, with batch conversion and ZIP export.
  • A real app experience everywhere. iPhone PWA installed from Safari (no App Store), a single-file Windows exe, a macOS app. Russian and English UI, light/dark, two color themes.

Get it

Platform How
Terminal (any OS) uv tool install trimitdown — no GUI, no system prompts, see Command-line package
Windows Download TrimItDown-windows-x64.exe from Releases — a single file, no installer
macOS (Apple Silicon / Intel) .dmg from Releases — mount it, drag TrimItDown into Applications, then First launch
iPhone / iPad Served by your own Docker server — open it in Safari → Share → Add to Home Screen
Docker server See Self-hosting below

The desktop apps work fully offline out of the box. Point them at your server in Settings to get the shared archive.

First launch

The apps are not signed with a developer certificate, so each platform asks once before it will run a program it does not recognise. This happens once per downloaded copy, not on every launch.

  • macOS — the first launch is refused; dismiss the warning, allow the app under System Settings → Privacy & Security → Open Anyway, then launch it again.
  • Windows — SmartScreen → More info → Run anyway.

Every release publishes SHA-256 checksums — that is what you can verify in place of a signature.

Command-line package

To install it for good: uv tool install trimitdown, or pipx install trimitdown. A plain pip install into the system Python is refused on many distributions and on Homebrew (PEP 668), which is why both commands above put the package in an isolated environment.

trimitdown convert report.pdf -o report.md

Without -o, Markdown goes to standard output; input can arrive as a stream: trimitdown convert - --type pdf. The CLI works fully offline.

To try it once without installing: uvx trimitdown convert report.pdf. Note that the first run still downloads the whole dependency graph — "without installing" means "without a trace on the system", not "without a download".

Self-hosting

The Docker server is the source of truth: it converts, stores the shared archive, and serves the iPhone PWA.

git clone https://github.com/serjdrej/trimitdown.git
cd trimitdown/docker-server
# one-time: generate a self-signed HTTPS certificate (copy-paste command in docker-server/README.md)
docker-compose up -d --build

Then open https://YOUR_SERVER:8002. Full instructions — certificate generation, trusting it on iOS/Windows/macOS, and the API — in docker-server/README.en.md.

Screenshots

Archive, shared across devices Settings
Archive with search Settings screen
Ocean theme, light Ocean theme, dark
Ocean light theme Ocean dark theme
The iPhone PWA — home screen Converting a PDF
TrimItDown PWA on iPhone, empty state TrimItDown PWA on iPhone, conversion result

How it works

  • The Docker server is a FastAPI service with HTTPS; the archive lives on the server. The same service serves the PWA for iPhone.
  • The Windows/macOS apps check at startup whether your server is reachable: if yes, they open straight on it (shared archive); if not, they spin up a bundled local server and work fully offline. The shell is pywebview (WebView2 / WKWebView), packaged with PyInstaller.
  • Conversion: PDFs go through TrimItDown's own engine (trimitdown-pdf, built on pdfplumber); every other format goes through Microsoft's MarkItDown.

Repository layout

Contributing

Bug reports and PRs are welcome — see CONTRIBUTING.md. DEVELOPMENT.md documents the dev setup and the desktop build internals.

Limitations

  • The server's self-signed HTTPS certificate needs a one-time manual trust on each device (iOS: profile + full trust; Windows: import into CurrentUser\Root; macOS: Keychain).
  • Unsigned binaries: one manual approval per downloaded copy — see First launch.

License and credits

Code is MIT. Non-PDF conversion is powered by MarkItDown (Microsoft, MIT); the bundled third-party licenses are listed in THIRD_PARTY_NOTICES.md.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trimitdown-0.1.1.tar.gz (796.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

trimitdown-0.1.1-py3-none-any.whl (790.9 kB view details)

Uploaded Python 3

File details

Details for the file trimitdown-0.1.1.tar.gz.

File metadata

  • Download URL: trimitdown-0.1.1.tar.gz
  • Upload date:
  • Size: 796.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for trimitdown-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9b556c0dc1eb7a295816a3ab1c9a0f1fa82619fd7f59091b504ebabc7e77814b
MD5 4fb70157b85c9bc6faeaecd615faf8b2
BLAKE2b-256 b00c711f8190215b48b49a93e010e41dd18d1e03d4fe28a8a3341be95c4646fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for trimitdown-0.1.1.tar.gz:

Publisher: publish-pypi.yml on serjdrej/trimitdown

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file trimitdown-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: trimitdown-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 790.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for trimitdown-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 88d2cca1c56d1165ad7213412f913fa561cf361c6a32b5bbfcb4c281ab7d07b6
MD5 638126874338deffd2eedb994e8d98c1
BLAKE2b-256 11ee303db6c2c2317e639c2acc222b6b68389bb787543f6bb89bf6ee9f6f826d

See more details on using hashes here.

Provenance

The following attestation bundles were made for trimitdown-0.1.1-py3-none-any.whl:

Publisher: publish-pypi.yml on serjdrej/trimitdown

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 files

0.1.0

2 files

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