PDF to Markdown Converter
Convert PDF to Markdown online free. Keeps headings, lists, tables, links and code, drops page headers and footers, and counts LLM tokens. Nothing is uploaded.
- Runs in your browser
- Nothing is uploaded
- Free, no sign-up
This free PDF to Markdown converter turns a PDF into clean Markdown in your browser. It rebuilds headings, paragraphs, bulleted and numbered lists, tables, code blocks and links from the PDF's layout, removes repeated page headers, footers and page numbers, and shows the word and token count. Copy the result or download a .md file. Nothing is uploaded.
How do I convert a PDF to Markdown?
- Drop your PDF onto the box above, or click it to choose a file.
- Wait a moment while every page is read. Long PDFs show their progress.
- Check the result in the Markdown tab, or switch to Preview to see it formatted.
- Press Copy Markdown, or Download .md to save a file named after your PDF.
To convert part of the document, type a page range such as 3-10. Untick Remove page headers, footers and page numbers if you need them kept.
How to convert PDF to Markdown for LLMs
Pasting raw text from a PDF into ChatGPT, Claude or Gemini loses the structure: headings look like ordinary sentences, table cells run together, and every page repeats the same header and page number. Markdown keeps that structure in plain text that language models read well, which is why tools such as Microsoft's MarkItDown were built to feed documents to LLMs.
The converter shows how many tokens the Markdown uses, counted with o200k_base, the tokenizer of GPT-4o and newer OpenAI models. Other models count a little differently, but the number tells you whether a document fits in a context window. For exact counts per model, paste the Markdown into the AI Token Counter. Removing headers and footers and converting only the pages you need are the easiest ways to cut the count.
What does the converter keep from the PDF?
A PDF does not store "this is a heading" or "this is a table". It stores characters at positions on a page, in a font and size. The converter reads those with pdf.js and works out the structure from the layout:
| In the PDF | How it is detected | In the Markdown |
|---|---|---|
| Headings | Text larger than the body, or short bold lines | # to #### headings |
| Paragraphs | Line spacing, indents and short last lines | Joined lines, with words split by a hyphen at a line end rejoined |
| Lists | Bullet and number markers such as •, -, 1. and a) | - and 1. items, nested by indent |
| Tables | Text in two or more aligned columns | Markdown pipe tables |
| Code | Monospace fonts | Fenced code blocks with indentation kept |
| Bold, italic and links | Font names and the PDF's link areas | **bold**, *italic* and [text](url) |
| Table of contents | Dot leaders before a page number | A list of entries with page numbers |
| Page headers, footers and numbers | Text repeated at the top or bottom of pages | Removed (you can keep them) |
| Images and charts | Pictures, not text | Left out |
The output follows GitHub Flavored Markdown, so the tables and lists display correctly on GitHub, in Obsidian and Notion, and in most Markdown editors.
Why is the Markdown empty or out of order?
- Empty result: the PDF is a scan or a picture of text. Run OCR (text recognition) on it first.
- Lists without bullets: some PDFs draw bullets as small shapes instead of characters, so there is no marker to find. The items still come out as separate lines.
- Mixed-up columns: text is converted in the order the PDF stores it. Most two-column papers store one column after the other, but a few interleave them line by line.
- Strange characters: some PDFs use fonts without a proper character map, so even copy and paste from a PDF reader gives garbled text. The converter cannot recover those characters.
PDF to Markdown with Python
For batch jobs, two open-source Python libraries do the same conversion. MarkItDown from Microsoft converts PDFs, Word and PowerPoint files and more:
pip install 'markitdown[all]'
markitdown report.pdf -o report.mdPyMuPDF4LLM is built for LLM and RAG pipelines:
import pymupdf4llm
md = pymupdf4llm.to_markdown("report.pdf")Both need Python installed. For a single file, the converter on this page gives the result without any setup.
Your PDF stays private
The PDF is read and converted on your own device. Nothing is uploaded, so confidential documents are safe. Need the reverse? The Markdown to PDF Converter turns Markdown back into a PDF. To count the words in a PDF, use the PDF Word Counter, and to save its pictures, use Extract Images from PDF.
Frequently asked questions
How do I convert a PDF to Markdown for free?
Drop the PDF onto the box above or click it to choose one. The Markdown appears in a few seconds, with headings, lists, tables and links kept. Copy it or download it as a .md file. There is no sign-up, page limit or watermark.
Is this a good way to give a PDF to ChatGPT, Claude or another LLM?
Yes. Markdown keeps the structure a model needs, such as which lines are headings and which text belongs to a table, without the layout noise of raw PDF text. The converter also drops repeated page headers, footers and page numbers, and shows the token count so you know whether the text fits in a context window.
Why is the Markdown empty for my PDF?
The PDF is almost certainly a scan or a photo of pages. It holds pictures of text rather than text, so there is nothing to convert. Run it through OCR (text recognition) first, for example in Acrobat or another PDF app, then convert the new file.
Does it convert tables to Markdown tables?
Yes, when the PDF has real text laid out in aligned columns, which covers most tables made in Word, Google Docs, Excel and LaTeX. Each row becomes a row of a Markdown pipe table and the first row is used as the header. Tables with merged cells or cells that wrap onto many lines may need a quick tidy-up.
Are images included?
No. Markdown stores images as links to separate files, so pictures and charts are left out and only the text is converted. To save the images, use the Extract Images from PDF tool.
Can I convert a password-protected PDF?
Yes, if you know the password. The tool asks for it, and the PDF is unlocked in your browser only for the conversion.
Can I convert only some pages?
Yes. Type a range in "Pages to convert", for example 3-10 or 1, 4-6. The Markdown updates instantly, without reading the PDF again.
Is my PDF uploaded?
No. The PDF is read with pdf.js, Mozilla's open-source PDF engine, running in your browser. The file never leaves your device, so it is safe for contracts, reports and research papers.
More PDF tools
View all tools- Merge Odd and Even PDF PagesCombine front and back scans into one PDF in the right order. Interleaves odd and even pages and fixes reversed backs. Free, nothing is uploaded.
- PDF Word CounterCount the words, characters and pages in any PDF, or many PDFs at once, with a per-page breakdown and page ranges. Free, nothing is uploaded.
- Extract Images from PDFExtract every image from a PDF at full resolution, or save each page as a PNG or JPG, then download them all as a ZIP. Free, nothing is uploaded.
- PDF DPI CheckerCheck the DPI of every image in a PDF at its printed size, flag anything below 300 DPI, and see each page size in inches and mm. Free, no upload.
- Remove Blank Pages from PDFFind and remove blank pages from a PDF automatically, with page previews and adjustable sensitivity for scans. Free, nothing is uploaded.
- Markdown to PDF ConverterConvert Markdown to PDF online free. Paste text or open a .md file, preview tables, code and LaTeX math live, then save a clean PDF. Nothing is uploaded.