Skip to site navigation
PDF

PDF tools

PDF and Markdown, both directions, parsed locally. No model, no upload, no token cost.

What for
All 4
Which one

Picking the right converter

Three of the four pages below run the same conversion. They exist as separate pages because people arrive with different questions about it, and each page answers the one its visitors actually asked.

  • PDF to MD

    Start here when the output is going into a repository or into a prompt. Dropping the PDF wrapper cuts the token count well below what pasting raw extracted text costs you.

  • PDF to Markdown

    The same conversion described from the heading side. Read this one if your document opens with an oversized cover title and you want to know why that title does not turn every paragraph under it into a heading.

  • PDF to Markdown converter

    Written for anyone weighing this against a converter that calls a language model. It covers what rule-based detection gets right and where a model would beat it.

  • Markdown to PDF

    The other direction. Your Markdown is rendered in the page and handed to the browser's own print engine, so the file is written on your machine and arrives without a watermark.

Mechanism

How PDF to Markdown conversion works here

pdf.js opens the file inside your tab and hands back every text fragment on the page, each one carrying a font name, a size and a position. Nothing in that step guesses at meaning and nothing crosses the network. What follows is a set of layout rules reading those three properties.

Heading level comes from font size, measured against the size that appears most often on the page. That most common size is the body text by definition, so a fragment measurably larger than it becomes a heading and the ratio decides which level. Working from the largest size on the page instead would let one huge cover title drag ordinary paragraphs up with it, and that is the failure people notice first in other converters.

A fragment whose font name identifies a monospace face opens a fenced code block, and the block closes when the font changes back. Bullet characters and numeric prefixes at the start of a line become list items, with the indent level taken from how far right the fragment sits. Every one of these decisions reads a property already stored in the file, which is why the same document produces the same Markdown every time you run it.

Repeated running headers and footers can be stripped, and that option can be switched off. With it on, a line has to fail three separate tests before it goes. It has to repeat across most of the document's pages, and it has to sit in the top or bottom 15% of its page. Then its vertical position has to hold steady from page to page, which is what separates a running header from a sentence that happens to recur. Clear any one of those tests and the line stays. A one-page document therefore loses nothing, because a single page gives a line nothing to repeat against, and the converter prints how many lines it dropped so you can check the count against the original.

Cost

No model reads your document

A converter built on a language model handles a messy magazine layout better than this one does, and it can make a reasonable guess at a table's structure. It also transmits your document to whoever runs that model and bills by the page, and it can return two different results for the same file on two different days.

The rules here run on your own machine at no cost and return the same output every time, and the price of that is doing worse on genuinely chaotic pages. Documents that were typeset consistently are where this approach is strongest.

Other way

Markdown into a PDF, printed by your browser

Going the other direction needs no parser at all. The Markdown is rendered into a styled document inside the page, and then the browser's print pipeline is pointed at it. Every modern browser already ships a competent PDF writer for exactly this, so no server is involved.

Page size and margins are decided in the print dialog, along with whether backgrounds print, and none of it is overridden here. Choose Save as PDF as the destination rather than a printer. If code blocks arrive without their shading, switch on the background graphics option, which most dialogs file under more settings.

Limits

What these tools cannot do

  • A scanned document is a picture of a page with no text layer underneath it. There is no OCR here, and the tool says so rather than handing back an empty file.
  • Tables come out imperfect. A PDF stores a table as positioned text carrying no row or column structure, so anything past a simple grid is worth checking by hand.
  • Multi-column layouts are read in the order pdf.js reports the fragments, and a densely typeset two-column academic paper can come back with its columns interleaved.
  • Bold and italic inside a paragraph are not reconstructed. Headings and lists survive, and so do code blocks and paragraph breaks, which is where the document's structure actually lives.
  • Code set in a proportional font is invisible to the detector and arrives as an ordinary paragraph, since detection keys off the font name the file reports.
  • Going the other direction, page breaks land wherever the print engine puts them and fonts come from what your machine has installed, so the same Markdown can paginate differently on another computer.
  • Some mobile browsers offer no Save as PDF destination at all, which puts that direction out of reach on those devices.