PDF to Markdown Converter
Operator: Abdulla Al Fahad. How tools are built and checked
Markdown has become the format for notes, wikis and the context people paste into language models, and much of the source material arrives as PDF: reports, papers, slide decks, minutes. The PDF to Markdown Converter reads the PDF's text layer and writes Markdown with # and ## headings where the font size says there was a heading, paragraphs rebuilt from the wrapped lines, and - or 1. list items where the page had bullets or numbers.
This is text extraction with structure detection, not layout analysis: headings are inferred from font size alone, bold is detected only for whole paragraphs set in a bold font, tables come out as lines of text, and multi-column pages are read across rather than down. Scanned and password-protected PDFs are refused. The result appears in a preview with a Copy button and downloads as a .md file named after the PDF.
Key features
- Rebuilds paragraphs from wrapped lines and writes # and ## headings from font size, with whole-paragraph bold as ** marks.
- Turns bullets, dashes and numbers at the start of a body-sized line into - and 1. items, while a large numbered line stays a heading.
- Summary chips for pages, words, paragraphs, headings and list items, with a preview, a Copy button and a .md download.
- Refuses scanned and password-protected PDFs with a message that says what to do next.
What the Markdown contains
The text layer is read by the same code as the PDF to Word converter, and that page sets out how fragments become lines, lines become paragraphs and oversized lines become headings. For Markdown the outcome is what matters: two heading levels, written as # and ## and never ###, and a line is a heading only because its font is clearly larger than the body text, never because it is bold. Two details are specific to this output. A heading-sized line that begins with a number, such as 1. Overview at 14pt, is a numbered heading rather than a list item (a bullet character always means a list) and is written as ## 1\. Overview, the backslash keeping the number from reading as a list. And the bold flag the detector puts on headings is dropped, so a title is written as a plain # Annual Report 2025 line.
A paragraph whose every line is set in a font named Bold, Black, Heavy, Semibold or Demi is wrapped in **; bold words inside an otherwise regular line are not detected, because weight is read per line. Body-sized lines that open with a bullet, a dash or a short number become - or 1. items, numbered from 1 for each run and nested by how far they are indented relative to the first item. Characters Markdown would read as formatting are escaped, so a paragraph that opens with 1.5 million is written as 1\.5 million.
Everything else is a paragraph. Table rows are lines of text with their cells separated by spaces, and rows that sit close together merge into one paragraph. Columns are interleaved because lines are grouped by their vertical position across the whole page. Running headers, footers and page numbers appear as short paragraphs on every page, a paragraph that crosses a page break is split in two, hyphenation is left as written, and images, charts and form fields are omitted without a warning.
How it works
pdf.js opens the file in a web worker and returns each page's text as positioned fragments; grouping them into lines, paragraphs and headings is the shared PDF reader that the PDF to Word page describes. Each paragraph then gets one of three labels: heading when it is short and heading-sized, list item when it is body-sized and opens with a marker, body text otherwise.
The blocks go to the same Markdown writer as the Word to Markdown and HTML to Markdown converters, which writes headings as # lines without bold marks, paragraphs separated by blank lines, and list items with computed indentation and renumbering. The preview stops at 20,000 characters; Copy and the .md download hold the full text.
Common use cases
- An analyst pastes a 40-page PDF report into a language model as Markdown, keeping the headings at a fraction of the characters.
- A student converts lecture slides exported to PDF; slide titles become headings and bullet points become list items in a notes app.
- A developer rescues an API specification that exists only as a PDF into a Markdown file that can be versioned and edited.
- A researcher pulls a journal article into Obsidian with its section headings as ## lines.
How to use this tool
- Drop the PDF on the upload area and wait for the page count chip; a long file takes a few seconds to read.
- Look for the headings chip in the summary: if it is absent, no line was big enough to be read as a heading.
- Scroll the preview for interleaved columns, merged table rows and repeated page headers.
- Copy the Markdown straight into a prompt, note or wiki page, or keep it with Download .md.
Example
PDF text lines (size and font as read from the page)
Annual Report 2025 [20pt, Helvetica-Bold]
Letter from the chair [14pt, Helvetica]
Membership grew for the third year [10pt, Times]
running, and the new branch in [10pt, Times]
Leeds opened in May. [10pt, Times]
• Volunteers: 412 [10pt, Times]
• Events held: 37 [10pt, Times]
[gap of two lines]
Treasurer's note [10pt, Times-Bold]Markdown output
# Annual Report 2025
## Letter from the chair
Membership grew for the third year running, and the new branch in Leeds opened in May.
- Volunteers: 412
- Events held: 37
**Treasurer's note**Tips for best results
- Look for a headings chip in the summary; if it is missing, no line was 25% larger than the body text, and headings set in the body size with bold alone appear as ** paragraphs to promote by hand.
- For a PDF that is mostly tables, use the PDF to Text converter's Lines layout, which keeps each row on its own line, and build the Markdown table from that.
- Delete the repeated page header or footer once with a find-and-replace; it appears as the same short paragraph once per page.
- Slide decks convert well, since every slide title is large and every point has a bullet, but speaker notes live outside the page text and will not appear.
Edge cases to watch
Tables are not detected. Each row becomes a line with its cells run together, and rows with normal line spacing merge into a single paragraph.
Two-column papers come out interleaved, with a line from the left column followed by a line from the right.
Paragraphs separated only by a first-line indent, as in most typeset books, are joined, because the spacing between them is ordinary line spacing.
A body-sized line that opens with a dash followed by a space, such as an attribution, is taken for a bullet, and one opening with 12. or (3) becomes a numbered item.
Common errors and how to fix them
- No selectable text was found in this PDF. Scanned PDFs need OCR before they can be converted.
- Scanned pages are pictures with no text underneath. An OCR tool adds searchable text to such a file; convert its output rather than the original.
- This PDF is password-protected. Remove the password with Unlock PDF, then try again.
- Encryption hides the text layer. Open the Unlock PDF tool on this site, enter the password you know, download the unlocked copy and convert that.
- This file could not be read as a PDF.
- The file is damaged, truncated or not really a PDF despite its extension. If a PDF viewer can open it, use Save As or Print to PDF to write a clean copy.
- This file is larger than 25MB. Split it into smaller files and try again.
- Images, not text, make a PDF that big. Split it into parts with the Split PDF tool on this site, or re-save it with reduced image quality, and convert the parts one at a time.
Best practices
- Prefer PDFs exported from a word processor or slide tool; they have clean text layers, consistent font sizes and real bullet characters.
- Tidy the Markdown immediately after converting: remove repeated headers, fix hyphenation and rebuild any table while the PDF is still open beside it.
- Keep heading levels honest. The converter only writes # and ##, so demote or promote lines to match the document's real outline before publishing.
Preparing PDF text for a language model
Markdown is a compact carrier for model context: the headings and list markers that survive conversion are the structure a model uses to find its way around a document. English prose runs at roughly four characters per token, so the 20,000-character preview is about 5,000 tokens and a 40-page report of some 120,000 characters about 30,000, which is why long documents are usually split before they are pasted. The conversion runs on your device, so a confidential contract can be reduced to text before you decide which parts, if any, go to an external assistant.
Split at the ## lines, so each section begins with its own heading, and prepend the document's # title to every chunk so a section called Methods is still recognisably that report's Methods. Keep a list or a flattened table inside one chunk, and number the chunks in order so an answer can be traced back to its place in the document. A short script that breaks the file on lines starting with ## does all of this.
Frequently asked questions
Why is a bold line sometimes a heading and sometimes **bold text**?
Size decides, not weight: a short line set noticeably larger than the body text becomes a heading and loses its bold flag, while a bold line of body size stays a paragraph wrapped in **.
Why did my table turn into a paragraph?
A PDF stores a table as positioned text with no row or cell structure, and this converter does not try to reconstruct it. The Lines layout of PDF to Text keeps one row per line.
Why are my paper's columns mixed together?
Lines are grouped by vertical position across the whole page, so a line from the left column is followed by the line at the same height in the right column; reorder the paragraphs by hand.