Turn the text of a PDF into Markdown with headings and lists. Runs on your device.
This tool converts a PDF to Markdown by reading the text stored in the file and turning its font sizes, line gaps and list markers into headings, paragraphs and lists. A PDF does not store headings or paragraphs. It stores small pieces of text with a position and a font on the page. The tool first joins the pieces that sit on the same baseline into lines. It then finds the body size, which is the font size that most of the characters use. A line set clearly larger than the body becomes a heading: 1.6 times the body size or more is a level 1 heading (#), 1.3 to 1.6 is level 2 (##) and 1.12 to 1.3 is level 3 (###). For example, an 18 pt line over 11 pt body text is 1.64 times larger and becomes a # heading, while a 14 pt line over the same body is 1.27 times larger and becomes a ### heading. A line that is long, ends in a comma or holds only symbols is never made a heading. Lines are joined into one paragraph until the gap to the next line is more than 1.4 times the usual line spacing, or a short line ends a sentence, or a line is indented after one that is not.
A line that starts with a bullet such as a round dot, a square, a dash or an asterisk followed by a space becomes a list item that starts with a hyphen. A line that starts with a number of up to three digits and a full stop or a bracket keeps its number, so 2) becomes 2. at the start of the item. Text that wraps under a list item with a hanging indent stays in that item. Bold and italic come from the font name only. If the font is called Arial-BoldMT or Times-Italic, the words become **bold** or *italic*. A PDF that fakes bold by drawing text twice, or that uses a font whose name says nothing, comes out plain. You can switch this off. When a line ends with a letter and a hyphen and the next line starts with a lower case letter, the hyphen is dropped and the two halves are joined, so co- and operation become cooperation. A real hyphen in a word such as well-known that happens to fall at a line end is joined the same way, so check those. Characters that Markdown reads as formatting, such as asterisks and backticks, are escaped with a backslash.
Running headers and footers would otherwise appear in the middle of your text on every page. With the option on, the tool looks at the first two and last two lines of each page and ignores capital letters and spacing when it compares them. Only a page number may differ: Page 3, 3 of 12, - 3 - or a bare number. Any other text with digits, such as Total $100, must match exactly to count as a repeat. A line that appears there on at least 60 percent of the pages that have text, and on at least 3 pages, is left out. So Page 3 of 12 and Page 4 of 12 count as the same line, and Total $100 and Total $200 do not. The result tells you how many lines were left out. A PDF with fewer than 3 text pages is never trimmed. A sentence that runs over a page break is joined into one paragraph when the first page ends without a full stop and the next begins with a lower case letter. If you ask for a --- line between pages, pages are not joined and each page break is marked instead.
Tables are not rebuilt. The cells of a table row come out on one line with wide gaps, and the result says how many lines look like that so you know where to check. Pages with two or more columns are read across, line by line, so sentences from neighbouring columns can be mixed. Images, drawings and page layout are not carried over, and links and footnotes are not turned into Markdown links or notes. Characters that Markdown would read as formatting, such as brackets, asterisks and backticks, get a backslash so text that looks like a link stays text. Text in right-to-left scripts such as Arabic or Hebrew may come out in the wrong order. A scanned PDF holds a picture of each page and no text, so there is nothing to convert. The tool lists such pages and points you to PDF to JPG followed by Image to Text. A PDF protected with a password cannot be opened until the password is removed. Read the Markdown once before you rely on it.
The PDF is opened and read by code running in this tab. There is no upload step and no server that receives your file or your text. The page counts visits with Google Analytics, using rough groups such as 1 to 10 MB, never a file name or any text from the document. The Markdown is kept in memory while the page is open and is not stored or put in the address bar. A PDF over 200 MB or over 1000 pages asks you to confirm before it loads, because a very large file can run out of memory on a phone.
Add the PDF, optionally type the pages you want such as 1-3, 5, then press Convert to Markdown. The result appears as text you can copy, and Download .md saves it as a file named after your PDF. The tiles show how many headings and list items were found.
Headings are found from font size. If the title is set at the same size as the body text, only bold, there is no size difference to see, so it stays a paragraph. A heading must be at least 1.12 times the body size: 12.5 pt over 11 pt body is level 3, 18 pt or more is level 1. Add the # marks by hand where the PDF gave no size hint.
No. Tables are not rebuilt. A row with several wide gaps stays on one line, for example Name Qty Price, and the result counts those lines. For a table, copy the lines into a spreadsheet or use the Markdown Table Generator to build the table again from the cells.
A scanned PDF holds a picture of each page and no text, so the tool finds nothing and says so, naming the pages. Convert the pages to images with PDF to JPG, then read them with Image to Text, which uses character recognition. A PDF made from a word processor, a web page or a spreadsheet has real text and works.
Bold is read from the font name, such as Arial-BoldMT or Calibri Bold. Some PDFs draw bold by printing the text twice or use a font whose name does not say Bold, and those come out plain. Switch the option off if it marks too much.
No. The PDF is read and converted in your browser, and the text is not uploaded. The page counts visits with Google Analytics using rough size groups such as 1 to 10 MB, never a file name or any text from the document.