PDF to Markdown — Turn a PDF into Clean, LLM-Ready Text
Convert a text-based PDF to Markdown with headings, lists and code kept, plus a token estimate. Nothing is uploaded.
Runs entirely in your browser — nothing you paste is uploaded or stored.
What is pdf to markdown?
This tool converts the text of a PDF into Markdown, the plain-text format that documentation sites, note apps and AI chat tools all understand. It reads the words from the PDF, rebuilds paragraphs from the line spacing, turns text set larger than the body into Markdown headings, turns bulleted and numbered lines into lists, keeps fixed-width text in fenced code blocks, and writes web addresses as links. You can copy the result or download it as a .md file, and the page shows an estimated token count so you can see whether the document fits in a model's context window before you paste it in. Everything happens in your browser, so the PDF stays on your device. It works on PDFs that contain selectable text. A scanned PDF has no text to read and is pointed to PDF to Text (OCR). The conversion is best-effort: simple tables become Markdown tables, bold and italic text keeps its emphasis, two-column pages are read in order, and pictures can be saved alongside in a ZIP. Merged cells and exact fonts are not reproduced.
When to use it
- Preparing a PDF paper, manual or report as clean text to paste into a chat with an AI assistant.
- Moving the content of a PDF into a documentation site, wiki or note-taking app that uses Markdown.
- Checking how many tokens a long PDF will cost before sending it to a language model.
- Extracting readable text from a PDF to diff against another version or to search with ordinary tools.
How to use this tool
- Drop a PDF onto the tool, or choose one from your device. The text is read immediately.
- Read the Markdown in the output pane and check the headings and lists look right.
- Copy the Markdown with the Copy button, or press Download to save it as a .md file named after your PDF.
- Use the link under the output to count tokens for specific models in the LLM Token Counter.
Example
A three-page sample with bold and italic words, a two-column page, a picture and a table.
Input
sample-layout.pdf, generated by the Load example button.Output
Markdown that starts "# Layout Sample", writes **Important:** in bold and the italic sentence in asterisks, reads the left column before the right, links the picture as  and writes the Item, Qty and Price grid as a pipe table. The download is a ZIP with the .md file and an images folder.Press "Load example" to generate the sample PDF and see the Markdown it produces.
Markdown that matches the document
The aim is Markdown you can use as it is. Headings keep their level so an outline survives. Lists keep their order, with a wrapped item joined back into one line. A code-like block, set in a fixed-width font in the PDF, becomes a fenced block that cannot be re-wrapped by accident. Paragraphs are joined into single lines, so the text re-flows wherever you paste it, and a word that was hyphenated across a line break in the PDF is put back together.
Using the result with an AI assistant
Pasting a PDF straight into a chat often works, but feeding in clean text is cheaper and more predictable: headers and footers, hyphenation and line breaks no longer burn tokens or confuse the model. The estimate under the output gives you a quick read on size, and the Markdown headings give the model structure to refer to. For a very long document, convert it, then split it into sections at the headings.
What it cannot recover
Text boxes, sidebars, footnotes and page furniture appear as ordinary lines where the PDF
prints them. Pictures, and logos or diagrams drawn as vector graphics, are cut out as separate images and linked with lines such as  and saved in an images folder inside a ZIP, small icons and full-page scan backgrounds excluded. Untick the picture option to get plain Markdown only. If the
file is a scan, nothing is extracted, and the page tells you so rather than returning an empty
result.
Frequently asked questions
Is my PDF uploaded anywhere?
No. The PDF is read inside your browser and the Markdown is produced on your device. Nothing you choose is transmitted, so it is safe to use on documents that are confidential or under an agreement.
How are headings decided?
The most common font size in the document is treated as body text. Short lines set at least 15 percent larger become headings, with the largest size as a first-level heading and smaller sizes as lower levels, down to level six. A PDF whose headings differ from body text only by weight or colour, not size, will not get heading markup.
Why is the token count only an estimate?
Each model family splits text into tokens with its own vocabulary, and the page uses a quick approximation rather than downloading a tokenizer. It is accurate enough to judge whether a document will fit, and the LLM Token Counter can give model-specific figures and costs for the same text.
Why are my tables garbled?
A PDF table is just text placed in a grid, with no row structure stored. The converter looks for rows of cells that line up and writes them as a Markdown table, which works for simple grids. Merged cells, tables without clear gaps and multi-line cells may come out as separate lines, so check tables by eye.
Can it convert a scanned PDF?
Not on its own, because a scan has no text layer. PDF to Text (OCR) reads scanned pages with text recognition, on request and on your device. You can paste its plain text into a Markdown editor.
Are special characters escaped?
Yes. Characters that Markdown would treat as formatting, such as asterisks, underscores, brackets and a leading hash or dash, are escaped so the text reads the same when rendered. Web addresses are left intact and written as autolinks.
Find these tools useful? A coffee helps keep them free and ad-light.
Buy me a coffee