To convert a PDF to Markdown, open our free PDF to Markdown converter, drop in the file, then copy the result or download it as a .md file. Headings, lists and tables come out as real Markdown, repeated headers and page numbers are removed, and the PDF is read inside your browser, so it is never uploaded. It works on PDFs that contain real text; scanned pages need OCR first.
Below is what the converter does with each part of a page, how it finds tables, and what to check before you hand the result to an AI.
Why Markdown works better than copied PDF text
Copying text out of a PDF viewer usually gives you a mess. Table cells run together on one line, so the AI cannot tell which number belongs to which column. Running headers and page numbers land in the middle of sentences. Words broken with a hyphen at the end of a line stay broken.
Markdown keeps the structure in plain text. A heading starts with #, a list item with -, and a table is a grid of cells between | characters (the table format is described in the GitHub Flavored Markdown spec). Because it is still plain text, you can paste it into any chat box, keep it in a prompt file, split it by headings for a retrieval (RAG) setup, and read it yourself before you send it.
Step by step
- Open PDF to Markdown.
- Choose or drop one PDF. It must be text-based and up to 50 MB.
- Set the two options. Add page markers is off by default; when on, it puts a hidden HTML comment with the page number before each page. Remove repeating headers, footers and page numbers is on by default. Changing either one converts the file again straight away.
- Read the status line, for example "Converted "report.pdf": 12 page(s), 9 heading(s), 3 table(s)." Below it, a size line shows the number of characters, the exact OpenAI token count (o200k_base) and an estimated range for Claude.
- Click Copy Markdown and paste it into your AI chat, or click Download .md to save a file named after your PDF.
What happens to each part of the page
| In the PDF | In the Markdown |
|---|---|
| Text larger than the body text | A heading, from # to ####. The most common text size counts as body text; sizes clearly bigger than it become heading levels, biggest first |
| Lines of one paragraph | One paragraph. A word split with a hyphen at the end of a line is joined again |
| Bullets such as •, - or * | List items starting with - |
| Items numbered 1. or 1) | A numbered list. Indented items are nested, up to three levels |
| A table with gaps between columns | A Markdown table. The first row becomes the header row, and a pipe character inside a cell is escaped so it cannot break the table |
| A page set in two columns of text | The left column first, then the right one |
| Running headers, footers, page numbers | Removed, unless you untick the option |
| Pictures, charts drawn as images, links, bold, italics | Not carried over. Only the text, its size and its position are read |
The converter also escapes a few characters that could change the meaning of a line. A paragraph that happens to start with #, > or 1. gets a backslash in front, so it does not turn into a heading, a quote or a list by accident.
How tables are found
A PDF has no idea what a table is. It only knows that a piece of text sits at a certain place on the page. So the converter looks at the gaps:
- Pieces of text on the same line with a wide gap between them (roughly the height of a letter or more) are treated as separate cells.
- Lines with two or more cells that sit close together form a block, and the columns come from where the text lines up across the block.
- A block counts as a table when at least two rows have two or more filled cells and the cells are short. Long cells suggest running text, so a block of two wide columns of prose is read as text instead.
- Text that wraps onto a second line inside a cell is added to the row above, and columns that are empty in every row are dropped.
For an example invoice table, the output has this shape:
| Item | Qty | Price |
| --- | --- | --- |
| Desk lamp | 2 | 24.50 |
| Lamp shade | 1 | 9.00 |
This works for most invoices, reports and statements. Tables without clear gaps, tables drawn as one image, and unusual layouts may need a quick fix by hand, so look over every table before you rely on it. If you need the table as a spreadsheet rather than Markdown, our PDF to Excel converter uses the same idea, and our guide to converting a PDF table to Excel without uploading it explains its options.
Tables and paragraphs that continue on the next page
With page markers off, the converter stitches content back together across page breaks:
- A table that ends at the bottom of one page and continues at the top of the next, with the same number of columns, becomes one table. If the second page repeats the header row exactly, the repeat is dropped.
- A paragraph that stops mid sentence at the bottom of a page, and continues with a lower case word on the next page, becomes one paragraph.
With page markers on, nothing is joined across pages, so every page stays separate under its own marker. Turn markers on when you want the AI to quote page numbers back to you, for example "which page mentions the delivery date?"
Headers, footers and page numbers
Only a small group of lines set apart at the very top or bottom of a page can count as a header or footer. Within those lines:
- Page numbers such as "4", "Page 4", "4 of 12" or "4/12" are removed.
- Other text is removed when it repeats on at least half the pages, and on at least three pages. Numbers are ignored when comparing, so "Annual report, page 4" and "Annual report, page 5" count as the same line.
If something you need disappears, untick Remove repeating headers, footers and page numbers and the file converts again with every line kept.
Scanned PDFs and pages without text
A scanned page is a photo, so there is no text to read. If the whole file has no text, the tool says it has "no selectable text" and explains that scanned pages need text recognition (OCR) first. It links to our paid PDF Table Extractor, which reads scans with OCR. If only some pages are empty, the result lists them, for example "2 page(s) had no text (5, 6). They may be scanned images and need OCR."
A quick test before you start: open the PDF and try to select a sentence with your mouse. If you can, the converter can read it.
Limits and messages
| Limit | Value |
|---|---|
| File size | 50 MB |
| Pages converted | The first 1,000. A longer file gets a note telling you to split it |
| Time | Stops after 5 minutes and tells you the last page read |
| Preview box | The first 2,000,000 characters. Copy and Download always give you everything |
| Columns per table | 200 |
| Password protected files | Not opened. Save a copy without the password and try again |
The PDF is read with the open source pdf.js library, served from our own site. Your file stays on your device the whole time, which matters for contracts, reports and statements you would not want to hand to an unknown server.
Fitting the Markdown into a prompt
The size line under the result tells you how many tokens the Markdown uses. If that is close to the limit of the model you use, open the token counter to see which models it fits, or split the Markdown at its headings and send it in parts.
If the document holds personal details such as emails or phone numbers, run the .md file through our tool to redact private data before pasting into AI. It accepts Markdown files and swaps those details for tags you can reverse later.
Other files
For Word documents, Excel workbooks and CSV files, use Word, Excel and CSV to Markdown instead; the PDF tool only accepts .pdf files and will point you there if you drop something else.
Frequently asked questions
Is my PDF uploaded to a server?
No. The PDF is read by your own browser with the open source pdf.js library, and the Markdown is made on your device. Nothing is sent to DealMahal or anyone else.
Does it work with scanned PDFs?
No. A scanned page is a picture with no text inside, so there is nothing to convert. The tool tells you when a file, or some of its pages, have no text. Scans need text recognition (OCR) first.
Do tables come out as Markdown tables?
Yes, when the table has clear gaps between its columns. Rows and columns are found from the position of the text on the page, and a table that runs onto the next page is joined into one. Check tables without clear gaps by hand.
Is there a size or page limit?
Files up to 50 MB, and the first 1,000 pages are converted. If a PDF has more pages, split it and convert each part. Very long files can be slow on a phone.
Are images, links and bold text kept?
No. The converter reads the text on each page with its size and position. Pictures, charts drawn as images, link targets, bold and italics are not carried over.
Which AI tools can read the result?
Any tool that accepts plain text. You can paste the Markdown into ChatGPT, Claude or Gemini, or load the .md file into your own LLM app or retrieval pipeline.
Spotted an error? Write to dealmahal.official@gmail.com.
Questions or corrections: dealmahal.official@gmail.com.