Toolsy
Back to blog

Guides

How to convert a PDF to Markdown step by step

12 min read

You need editable text, not a locked page layout. How to convert a PDF to Markdown step by step is a short loop: decide if the file has a real text layer or only page images, prepare a clean sample, convert, then fix headings and junk before you trust the .md. Use PDF to Markdown for a multi-page PDF. Use Image to Markdown when you only have a photo or a single scanned page. This guide covers the workflow and cleanup checklist. It does not rebuild a RAG pipeline, a tables-and-images deep dive, or a CLI bake-off; those live in linked posts below.

Why you convert a PDF to Markdown

PDF keeps print layout. Markdown keeps structure you can edit in any plain editor, commit to git, paste into a notes app, or feed to a search index. Copy-paste from a PDF viewer often drops headings, breaks lists, and merges columns into nonsense paragraphs. A converter that emits #, ##, lists, and links gives you a starting draft you can fix once.

Teams hit this when someone sends a policy PDF, a research paper export, or a “final” deck printed to PDF. The source Word or HTML is gone. You still need a README section, a wiki page, or chunks for retrieval. Markdown is the portable middle format.

You also convert when you want search. Full-text search over a PDF is clunky in many note apps. A .md file indexes like any other text file. If your end goal is company RAG, follow prepare documents for RAG with Markdown after this conversion pass. If you only need one readable note, stop after cleanup.

Expect imperfect output. Hyphenated line breaks, running headers, and multi-column pages survive into the Markdown until you remove them. The convert step saves typing. The cleanup step makes the file usable.

Text PDF vs scanned PDF

Open the PDF and try to select a sentence with the mouse. If the letters highlight and copy into a text editor as real words, you have a text PDF. If you only drag a gray box over a picture of text, you have a scan or a photo of pages. That fork decides how much OCR you need and how much cleanup you will do.

Text PDFs come from Word, Google Docs, LaTeX, or “Save as PDF” from a browser. They still break: columns reorder, footnotes float, and fonts encode oddly. They usually beat scans for body prose.

Scanned PDFs are images glued into a PDF container. Without OCR, a converter may return almost nothing useful. With OCR, you get text that looks right until you check names, numbers, and rare words. Soft lighting, skew, and low DPI make OCR worse.

How to spot a scan in thirty seconds

Zoom to 200%. Soft, blurry letter edges and visible paper texture mean image pages. Sharp vector edges and selectable text mean a digital export. Password prompts, print-only permissions, and “image-only” viewer warnings also point at scans or protected files.

Check page count next. A 200-page scan of a binder needs a sample-first approach. Convert pages 1–3, judge OCR quality, then decide whether to continue or rescan.

What OCR changes in the Markdown

OCR invents plausible words. It confuses 1 and l, 0 and O, and garbles proper nouns. Tables from scans often become broken pipe rows or a wall of spaces. Captions may attach to the wrong paragraph.

Treat OCR Markdown as a draft transcript. Read every number and every name against the original page. For a phone photo of one sheet rather than a multi-page PDF, skip the PDF wrapper and use Image to Markdown instead.

Prepare the file before you convert

Ten minutes of prep beats an hour of repair in the .md.

Unlock the PDF if you know the password. Remove pages you do not need: blank covers, full-bleed ads, duplicate scans. Prefer the smallest file that still holds the chapter you care about. Free tiers and online tools have size and daily caps; a trimmed sample proves quality before you burn the quota on the whole book.

Redact secrets first. Conversion copies what it can read: API keys in appendices, customer lists, medical identifiers, internal URLs. If the file cannot leave the machine, convert offline with a local library and skip the upload path. For upload safety habits, read Is it safe to upload documents online? and check Privacy.

Straighten skewed phone scans before you wrap them as PDF. Crop margins that only hold binder holes. Dark, shadowed pages waste OCR.

Name the source clearly (policy-2024-source.pdf) so you can keep the original next to policy-2024.md after conversion.

Walkthrough: convert a PDF to Markdown online

You need three artifacts when you finish: the original PDF (archive), a cleaned .md, and a short note of what still looks wrong. Skip the archive and you cannot re-check OCR mistakes later.

Work one representative chapter or the first ten pages first. Time convert plus cleanup. Only then run the rest. Scaling a bad outline into fifty files wastes a week.

Keep the job small. One policy or one paper per convert pass beats dumping an entire shared drive into one Markdown blob nobody will edit.

Upload and download on PDF to Markdown

Open PDF to Markdown. Upload the prepared PDF under the size limit. Wait for the Markdown. Download or copy the .md into VS Code, Cursor, Obsidian, or any plain editor.

Confirm the document title is a single # line near the top. Promote true sections to ##. Demote running headers the converter treated as headings. Scan the first list you care about before you polish tone.

If the upload is a photo saved as .png or .jpg instead of a PDF, use Image to Markdown. Mixed formats in one folder can go through Convert to Markdown.

What “good enough” looks like on the first pass

Good enough means you can navigate by headings, paragraphs are in reading order, and lists still look like lists. It does not mean every table is perfect or every figure is extracted as a reusable image file.

If tables and charts are the point of the document, stop after a sample page and open PDF to Markdown with tables and images. That article owns fidelity limits. This one stays on the everyday how-to path.

Cleanup checklist after conversion

Open the PDF and the .md side by side. Fix structure before you rewrite sentences.

Remove repeated running headers and footers. Delete page numbers that landed as their own paragraphs. Join words split by end-of-line hyphens (docu- + mentdocument) when the hyphen is only a line break.

Fix heading levels. One # title. Real sections as ##. Do not leave a wall of bold paragraphs that were Heading styles in the PDF. Flatten accidental #### spikes from font-size noise.

Repair lists. Nested bullets from PDFs often flatten or pick up blank lines. Numbered procedures should use 1. items, not fake numbers inside paragraphs.

Skim for column bleed: a left column sentence glued to a right column sentence. Split those by hand. Check footnotes: they often appear mid-paragraph after conversion.

Quick visual QA pass

Search the .md for the PDF’s title string, one unique proper noun, and one number from a table or date line. If any is missing or wrong, the extract failed on that region. Re-convert a cropped PDF of that section, or type the critical line by hand from the original.

Preview rendered Markdown once. Broken links, empty image placeholders, and huge indented code fences from monospace PDF text show up faster in preview than in raw source.

What to leave for a specialist article

Merged cells, multi-page tables, and chart-to-data extraction need a longer checklist. Soft-link PDF to Markdown with tables and images instead of inventing a second deep dive here. For RAG chunking and metadata after cleanup, return to prepare documents for RAG with Markdown.

When to use Image to Markdown instead

Use Image to Markdown when the source is a camera photo, a screenshot, or a single-page scan still sitting as an image file. Wrapping that photo in a one-page PDF adds no value and can worsen OCR if the PDF compresses the image again.

Use PDF to Markdown when you already have a multi-page PDF, a text export, or a scanned packet with many pages. Batching pages inside one PDF keeps order and filenames simpler than converting twenty loose JPEGs.

Phone photos of whiteboards, sticky notes, or handwritten pages follow the image path. For camera framing tips that improve OCR before either tool, see phone camera tips for better OCR when that habit is the bottleneck.

If you need a local CLI for automation, Microsoft’s MarkItDown and tools like Marker belong in other posts: What is MarkItDown? and Marker vs MarkItDown vs online. This guide stays on the browser workflow plus cleanup.

Limits, privacy, and related jobs

Online conversion is for files you are allowed to upload. Skip patient charts, credentials, and anything under a strict data-processing agreement unless your policy allows a vetted vendor. Prefer a local install when legal or security teams block browser uploads. Retention and processing details live in Privacy and what happens to files after processing.

Converters do not magically rebuild design. Complex layouts, equations, and scanned handwriting remain hard. Expect manual fixes. Huge books belong in sample-first batches, not one blind upload.

Related jobs on Toolsy: Word drafts → Word to Markdown; mixed types → Convert to Markdown; photo of a page → Image to Markdown. For LLM-shaped Markdown after you have clean text, why LLMs prefer Markdown over PDF explains the format choice without repeating this how-to.

Frequently asked questions

How do I convert a PDF to Markdown online?

Open PDF to Markdown, upload a PDF you are allowed to share, and download the .md when processing finishes. Open the file in a plain editor and run the cleanup checklist: headings, headers, lists, hyphenation. Keep the original PDF so you can spot-check names and numbers.

How can I convert a PDF to Markdown for free?

Many online tools offer a free daily cap and a file size limit; Toolsy’s free tier works the same way for sample jobs. Convert a short sample first so you do not burn the quota on a broken scan. For unlimited local runs, install an offline library such as MarkItDown and follow What is MarkItDown?.

Can I convert a scanned PDF to Markdown?

Yes, if OCR runs on the image pages. Select text in a PDF viewer first; if nothing highlights, treat the file as a scan. Expect more cleanup than with a text PDF, especially for tables and rare names. For a single photo instead of a multi-page scan packet, prefer Image to Markdown.

How do I convert a PDF to Markdown locally?

Use a CLI or Python library on your machine when uploads are forbidden. MarkItDown covers many office formats; Marker is a common choice when layout and tables matter more. Compare those options in Marker vs MarkItDown vs online rather than pasting install commands into every how-to. Local still needs the same cleanup checklist after the .md lands.

How can I batch convert PDF files to Markdown?

Convert one representative file, time the cleanup, then script or repeat only if the quality is acceptable. Blind batch jobs multiply broken headings and OCR errors. For developer API and automation paths, wait for a dedicated API guide; soft-check What is MarkItDown? for local batch patterns today.

Does PDF to Markdown keep tables and images?

Body text and simple pipe tables sometimes survive. Merged cells, multi-page grids, and charts usually need hand fixes or stay as captions only. Read PDF to Markdown with tables and images for that fidelity map. Do not assume a visual twin of the PDF after one click.

Is it safe to upload a PDF to an online converter?

Only if the content is appropriate to leave your device and the vendor’s retention policy matches your rules. Redact secrets before upload. For a practical checklist, see Is it safe to upload documents online? and Toolsy Privacy. When in doubt, convert offline.

What is the best way to convert a well-formatted PDF to Markdown?

Start with a text PDF, not a scan. Convert a sample chapter online or with a layout-aware local tool, then fix headings and lists by eye. For shopping comparisons across Marker, MarkItDown, and browser tools, use Marker vs MarkItDown vs online. “Best” depends on whether you need speed, privacy, or table fidelity.

How do I convert PDF to Markdown in Python?

Install a library such as MarkItDown or another PDF parser, run it on disk, and write the .md next to the source file. That path fits automation and CI. Keep this article’s cleanup steps even when a script emits Markdown. For productized HTTP APIs, use a dedicated developer guide when it ships; do not treat a blog how-to as an SDK reference.

Should I use Image to Markdown or PDF to Markdown?

Use Image to Markdown for photos, screenshots, and single-page image files. Use PDF to Markdown for multi-page PDFs and digital exports with a text layer. If you already wrapped photos in a PDF, you can still use the PDF tool, but a clean image upload often OCRs more predictably.

For the convert step itself, start at PDF to Markdown. When the source is a photo, use Image to Markdown. When the source is PowerPoint, see export PowerPoint to Markdown for LLM editing. Soft-link prepare documents for RAG with Markdown, PDF to Markdown with tables and images, What is MarkItDown?, and Marker vs MarkItDown vs online when those jobs are the next click.

Convert PDF to Markdown

Upload a PDF, download Markdown for notes or docs. We process for the response, then drop the upload.

Convert PDF to Markdown
Share this article

More to read

How to convert a PDF to Markdown step by step — Toolsy