How to convert PDF to Markdown: common methods and steps

To convert PDF to Markdown, first determine whether the PDF is a digital version or a scanned version, then choose text extraction, convert to Word first or do OCR first, and finally check the title, table and formula. This article provides general steps and checklists.

Key points of this article

  • First determine whether the PDF is a digital version or a scanned version: if you can select text with the mouse, it is a digital version. If you cannot select the text, you need to do OCR first.
  • Text-based PDFs can be extracted directly and then sorted; documents with tables and formulas are recommended to be converted to Word first and then to Markdown.
  • After the scanned document is OCRed, numbers, names and proper nouns must be checked one by one. Recognition errors often occur in these places.
  • After conversion, check the title level, list symbols, table vertical bars and formula writing, and save it as a .md file with UTF-8 encoding.

Many people need to convert PDF to Markdown in order to put paper notes, technical documents or product descriptions into code repositories, knowledge bases or static websites. PDF is designed with a fixed layout, and content and layout are tied together. Direct copying often results in messy titles, broken paragraphs, and scattered tables. Markdown relies on pound signs, list symbols, and vertical lines to express structure, and there is no one-step correspondence between the two.

This article is written for readers who need to organize PDF into Markdown but are not sure where to start. After reading, you can determine which category your PDF belongs to, know which route each category should take, and master the inspection method after conversion. The methods in this article are universal and do not depend on a specific software.

How to convert PDF to Markdown? One sentence conclusion

Direct conclusion: first determine whether the PDF is a digital version or a scanned version, and then decide the route based on whether there are tables and formulas in the content. The digital version is mainly text-based, so it is easier to sort out after extracting the text; for documents with complex structures, it is more stable to convert them to Word first; the scanned version must be OCRed first so that the text can be selected and copied.

your situationRecommended practicesreason
Digital PDF, mainly text, such as the main text of the paper and documentationExtract text and add titles and lists in the Markdown editorThe text can be obtained directly, there is less structure, and the amount of manual sorting is small.
Digital PDF, containing more tables, formulas, and multi-level headingsConvert to Word first, then convert Word to MarkdownStructural information in Word is retained more completely than direct extraction
Scanned PDF, or page taken as a photoFirst OCR generate a version of the optional text, and then process it according to the above two methods.There is no text information in the scanned document and cannot be extracted without OCR.
There are only a few pages and I only want one paragraphSelect and copy the content, then paste and manually add Markdown symbolsManual processing is faster when the number of pages is small and does not require a conversion process
File contains sensitive contentPrioritize using local tools instead of online conversion websitesUploading files online will hand over the files to a third party. Please read the other party’s privacy statement first.

Before you start: Confirm these points first

Taking two minutes to make a judgment before taking action can save a lot of rework time.

  • Confirm if the PDF is a digital version. Use the mouse to drag and select a section of text. If it can be selected and copied, it means that the text layer exists; if it cannot be selected, or only the whole page image can be selected, it means that it is a scanned document and needs to be OCRed first.
  • List structures that need to be preserved. There are several levels of titles, whether there are lists, tables, code blocks, formulas and pictures. The more structures there are, the more you should take the "convert to Word first" route.
  • Clear the purpose of Markdown. If you are publishing to GitHub, a blog, or a static website, be aware of differences in syntax support for tables and mathematical formulas on the target platform.
  • Check the privacy and size of files. Documents including contracts, medical records, and unpublished papers should be processed locally first. When using an online conversion site, be sure to read its instructions on how long your files will be stored and what they will be used for, and be aware of file size limits.
  • Allow time for verification. Regardless of the route, the conversion results require manual verification. Both OCR and automatic conversion can go wrong.

Steps to convert digital PDF to Markdown

The following is a general process for processing digital PDFs, which is suitable for text-based documents such as papers, technical documents, and instructions.

  1. Confirm that the text layer exists. Use the mouse to drag and select a paragraph in the text. If it is selected, you can directly extract the text without OCR.
  2. Determine the route. Extract text directly with a simple structure; if there are tables, formulas or multi-level titles, first convert PDF to Word, and then convert from Word to Markdown.
  3. Extract content. When extracting directly, use a universal PDF text extraction tool, or copy and paste into a plain text editor; when converting to Word, use a universal conversion tool or an online conversion website to generate a .docx file.
  4. Clean up excess content. Delete the header, footer and page number that appear repeatedly on each page. These contents are useless in Markdown.
  5. Added Markdown structure. Use one hash mark for first-level titles, two for second-level titles, and so on; add dashes and spaces at the beginning of rows for unordered lists, and use numbers and dots for ordered lists. Leave blank lines between paragraphs.
  6. Process tables and formulas. Markdown tables are separated by vertical lines, and a short horizontal line is required below the table header. The way the formula is written depends on the target platform, it can be rewritten into LaTeX syntax, or left as an image.
  7. Save and preview. Save it as a .md file using UTF-8 encoding, and then open it with an editor that supports Markdown preview to check the rendering effect.

Convert scanned PDF to Markdown: do OCR first and then convert

The text in the scanned document exists in the form of an image and cannot be extracted directly. You need to use OCR (optical character recognition) to generate a PDF with a text layer first. The OmniDoc desktop client's PDF editor provides OCR functionality to recognize scanned PDFs. Its function is to generate selectable text and does not directly output Markdown, so after OCR, you still need to complete the conversion according to the previous steps.

  1. Open the scanned document. Open the file to be processed in the desktop PDF editor.
  2. Perform OCR. Use the OCR function in the editor to let the software recognize the text on the page and generate a selectable text layer.
  3. Spot check the identification results. Randomly select a few paragraphs and compare them with the original text, focusing on numbers, names of people, place names, proper nouns and formula symbols. These contents are easy to identify errors.
  4. Export to Word. Export the recognized PDF to a Word file, retaining the basic structure of paragraphs and tables.
  5. Convert to Markdown. Start from the Word file, organize the titles, lists, and tables according to steps 5 to 7 of the digital version process, and save it as an .md file.

OCR results are affected by the quality of the original scan, with pages that are skewed, blurred, or handwritten often having poorer recognition. Important documents should be checked page by page and should not be published directly.

Check each item after completion

After the conversion is completed, don't rush to use the results, check them one by one according to the checklist below.

Check itemsHow to seeWhat to do if there is a problem
Title levelCompare the structure of the original article to see if the number of # and ## is reasonable.Reset the level according to the original table of contents to avoid all titles at the same level
paragraph completenessSee if the paragraph is hard broken in the middle of the sentenceMerge lines that were cut off by mistake, leaving a blank line between paragraphs
listCheck whether the list symbols are complete and whether the ordered numbers are consecutiveComplete symbols and numbers, do not include blank lines between list items
sheetIn the preview, check whether the rows and columns are aligned and whether the table header is complete.The number of rows and columns should be the same, and there should be no vertical lines in the cells.
Formulas and symbolsCheck superscripts, subscripts, Greek letters, and operators against the original textRewrite it to the LaTeX syntax supported by the target platform, and keep it as an image if it cannot be rewritten.
Recognition accuracySpot-check numbers, names, proper nouns, and quotationsGo back to the original text and correct it item by item. Errors are often concentrated in these places.
Headers, footers and page numbersSearch whether there is any remaining content such as "Page X"Remove duplicate headers and footers
Encoding and savingConfirm that the file is UTF-8 encoded and there is no garbled Chinese characters.Re-save as UTF-8 using editor

📊 Core comparison

Common PDF to Markdown methods are roughly divided into four categories according to the difficulty of operation and the degree of structural retention.

methodsuitable documentadvantageneed attention
Manual copying and organizingContent with few pages and simple structureNot dependent on tools, controllable resultsWhen there are many pages, it takes a long time and it is easy to miss content.
Extract text directly and then organize itDigital version, text-based documentFast and easy to operateTitles and lists need to be filled in manually, and tables are easily scattered.
Convert to Word first and then to MarkdownDigital document containing tables, formulas, and multi-level headingsThe structure remains relatively intactOne more step of conversion, and there may be a loss of detail in the intermediate format.
OCR first and then convertScan, photo PDFCan handle documents without text layerIdentification errors require manual verification, which takes a longer process

❓ Frequently Asked Questions (FAQ)

1. Can tables be preserved when converting PDF to Markdown?

Yes, but usually requires manual adjustment. Tables are often dismantled when extracting text directly. The route of converting to Word first retains the table structure better. After conversion, check whether the number of rows and columns is consistent, and confirm in the preview that the rendering is correct.

2. Is the method of converting pdf to markdown free?

It depends on the tool you choose. When choosing a free method, it is recommended to pay attention to the file size limit, whether there is a watermark, whether registration is required, whether your file will be saved, and whether the layout will be retained after conversion. There is usually no additional cost to manually copy and use local common tools.

3. What should I do if there are many typos in the scanned document after conversion?

First confirm whether the original scan is clear. The recognition rate of skewed or blurred pages will decrease. You can try to rescan before OCR. Numbers and proper nouns that contain errors should be corrected one by one according to the original text. Neither OCR nor automatic conversion can ensure complete accuracy, and important content must be checked manually.

4. The converted Markdown formula cannot be displayed, what should I do?

First confirm whether the target platform supports mathematical formula syntax. If it is supported, rewrite the formula into LaTeX writing; if it is not supported, you can save the formula as a picture and then insert it, while retaining the text description to facilitate readers' understanding.

5. How to convert pdf to markdown format without losing the original layout?

Fonts, colors, and page layout cannot be completely moved to Markdown. Markdown only expresses structure. If you need to keep the original format, you should continue to save the original PDF and maintain the Markdown separately as an editable text version.

📝 Summary

How to convert PDF to Markdown, the key is to first determine whether the file is a digital version or a scanned version, and then choose the route of direct extraction or conversion to Word first according to the structural complexity. Scans need to be OCRed first, and the converted titles, lists, tables, and formulas must be checked one by one, especially numbers and proper nouns. By following this process, you will get a Markdown file with a clear structure that can be used directly.

Open OmniDoc, convert and organize your documents

Updated 2026-11-12