AI & Productivity

How to Convert PDF to Markdown (and Save Tokens in ChatGPT & Claude)

What Markdown is, why clean text uses fewer AI tokens, and a step-by-step way to convert PDFs to Markdown on your phone for ChatGPT, Claude, Gemini, Obsidian and Notion.

Illustration of a PDF document turning into a clean Markdown file with sparkles

You drop a 60-page PDF into ChatGPT or Claude, and the answer comes back vague, cut short, or you hit a length limit before you've even asked your question. Part of the problem is the PDF itself: it's full of repeated headers, page numbers and layout leftovers that the AI has to read along with the content you care about. Converting the PDF to Markdown first gives you clean, structured text that's easier for AI tools, notes apps and editors to work with. This guide explains what Markdown is, why clean text saves tokens, and how to convert a PDF to Markdown on your phone with PDF2MD.

What Does It Mean to Convert PDF to Markdown?

Converting a PDF to Markdown means pulling the text out of the PDF and saving it as a plain-text .md file, where headings, lists and emphasis are marked with simple symbols instead of page layout. The result is lighter, searchable, and easy to paste into an AI chat, a notes app or a code editor.

A PDF is designed to look the same on every screen and printer. That's great for reading, but under the hood the text is stored as positioned fragments on a page. When you copy text out of a PDF, you often get broken lines, the same header repeated on every page, stray page numbers in the middle of paragraphs, and rows of dots from the table of contents.

Markdown takes the opposite approach: it stores only the text and its structure. No fonts, no page sizes, no positioning.

What Is Markdown? (A 30-Second Explanation)

Markdown is a lightweight formatting language created by John Gruber, with input from Aaron Swartz, in 2004. The idea was simple: write formatting in a way that still reads naturally as plain text.

  • # Chapter title becomes a heading.
  • - item becomes a bullet point.
  • **important** becomes bold.
  • *note* becomes italic.

Because it's just text, Markdown works almost everywhere. Obsidian stores notes as Markdown files, Notion can import and paste Markdown, GitHub renders it for README files and documentation, and many blogging and publishing tools accept it directly. AI chat tools also handle it well: ChatGPT, Claude, Gemini and DeepSeek commonly read and write Markdown-style formatting.

Why Clean Markdown Saves Tokens in ChatGPT, Claude and Gemini

What is a token?

AI models don't read words the way you do. They split text into small chunks called tokens. A token can be a whole word, part of a word, a number or a punctuation mark. As a rough rule of thumb that OpenAI gives for English text, one token is about four characters, or around three quarters of a word.

Tokens matter for three practical reasons:

  • Context limits. Every model can only consider a certain number of tokens at once. A bloated document uses up that space faster.
  • Cost. If you use an API, you usually pay per token, so every wasted character costs money.
  • Focus. The less junk the model has to read, the more of its attention goes to the content you actually asked about.

Where PDF text wastes tokens

Copying text straight from a PDF typically brings along a lot of noise:

  • The book or report title repeated at the top of every page.
  • Footers like "Confidential – Do not distribute" on every page.
  • Standalone page numbers dropped between paragraphs.
  • Dot leaders from tables of contents ("Introduction ........ 4").
  • Extra line breaks that split sentences in half.

On a long document, that noise adds up to thousands of characters the AI has to process for nothing. Stripping it out before you paste means the same content takes fewer tokens, and the structure (headings, lists) stays clear enough for the model to follow.

Clean input, better output: the fewer irrelevant characters you send, the more room the model has for your real question and its answer.

How to Convert a PDF to Markdown on iPhone or Android (Step by Step)

Here's the quickest way to do it with PDF2MD. The whole process takes a few taps and works offline.

  1. Open the PDF in PDF2MD. Choose a file from your device or the Files app, or use the Share Sheet from another app (mail, browser, cloud storage) and send the PDF straight to PDF2MD.
  2. Let it convert. The app turns the PDF into Markdown instantly, right on your phone.
  3. Let smart cleanup do its job. PDF2MD automatically removes repetitive headers and footers, standalone page numbers, dot leaders and extra line breaks.
  4. Check the savings. The app shows how much smaller the text payload became, so you can see how much noise was removed.
  5. Skim the result. Look over headings, lists and any tables. Simple documents usually need no edits; complex layouts may need a quick tidy-up.
  6. Send it where you need it. Copy the Markdown to your clipboard and paste it into ChatGPT, Claude, Gemini or DeepSeek, save it as a .md file to your device or cloud storage, or share it to a notes app, code editor or writing app.
  7. Find it again later. Your conversion history is stored locally, along with the character savings for each file.

PDF2MD: A Private PDF to Markdown Converter in Your Pocket

Most online PDF converters ask you to upload your file to their servers. That's a real concern if the PDF is a contract, a medical letter, internal company documentation or unpublished research. PDF2MD extracts the text on your device. There are no servers involved, nothing gets uploaded, and it works without an internet connection.

What you get:

  • Instant PDF to Markdown conversion from your device, the Files app or the Share Sheet.
  • Smart cleanup that strips repetitive headers, footers, standalone page numbers, dot leaders and extra line breaks.
  • A lighter payload: the app says the character count can drop by up to 50%, depending on how much clutter the original PDF has.
  • Flexible export: copy to clipboard, save .md files to your device or cloud, or share to notes apps, code editors and writing apps.
  • Local conversion history with character-savings stats for each document.
  • Light, Dark or system theme.
PDF2MD conversion result showing original and optimized size, cleanup stats and the Markdown output with Copy, Save .md and Share buttons
After converting, PDF2MD shows what was cleaned up and lets you copy, save or share the Markdown.

Here is the whole flow in under a minute:

PDF2MD: clean Markdown from any PDF, on your phone
A one-minute look at PDF2MD: open a PDF, get clean Markdown, and see how much smaller the file gets.
Private, on-device converter

PDF2MD: PDF to Markdown

Turn PDFs into clean, AI-ready Markdown on your phone, with no uploads and no internet needed. PDF2MD is a paid app ($4.99 on the US App Store at the time of writing).

Get PDF2MD on iOS & Android

What to Do With Your Markdown File

Feed documents to AI chatbots

Paste the Markdown into ChatGPT, Claude, Gemini or DeepSeek and ask for a summary, a list of key points, flashcards or answers to specific questions. Because the text is cleaner, more of the model's context goes to the actual content. For very long documents, paste one chapter at a time and keep the headings so the AI knows where it is.

Build a notes library in Obsidian or Notion

Save the .md file into your Obsidian vault and it becomes a regular note you can link, tag and search. In Notion, you can paste or import Markdown and keep the headings and lists intact. It's a simple way to turn lecture slides, research papers or manuals into notes you'll actually revisit.

Reuse content in docs and publishing

Developers can drop converted manuals or specs into a repository as documentation. Writers can move old reports or drafts into a Markdown-based editor or static site without retyping. Markdown is also easy to version-control, so you can track changes over time.

If your source is a web page rather than a PDF, a sibling app, WEB2MD, does the same job for URLs.

Honest Limitations: When PDF to Markdown Needs a Hand

No converter is perfect, and it helps to know where the edges are:

  • Scanned PDFs. PDF2MD extracts text from text-based PDFs. If your PDF is a scan or a photo of pages (you can't select the text when you open it), there's no text layer to extract. You'll need to run it through an OCR (optical character recognition) tool first.
  • Complex tables and layouts. Multi-column magazine layouts, nested tables and heavily designed brochures may come out in an order that needs some tidying.
  • Savings vary. A PDF with heavy headers, footers and a long table of contents shrinks a lot. A short, plain document has less noise to remove, so the savings will be smaller.

A quick test: open your PDF and try to highlight a sentence. If you can, it's text-based and should convert cleanly.

PDF to Markdown FAQ

How do I convert a PDF to Markdown?

Open the PDF in a converter such as PDF2MD, let it extract the text and clean up headers, footers and page numbers, then copy the Markdown or save it as a .md file. On a phone, you can send the PDF to PDF2MD straight from the Files app or the Share Sheet.

Why convert a PDF to Markdown before using ChatGPT or Claude?

Raw PDF text often includes repeated headers, page numbers and broken line breaks that waste tokens. Clean Markdown keeps the content and its structure while using fewer tokens, which leaves more room in the model's context for your question and its answer.

What is a token in AI?

A token is a small chunk of text, such as a word, part of a word or a punctuation mark, that AI models read and count. As a rough guide for English, one token is about four characters, so less text means fewer tokens.

Is PDF2MD free?

No, PDF2MD is a paid app. At the time of writing it costs $4.99 on the US App Store.

Does PDF2MD upload my files?

No. PDF2MD extracts the text on your device, with no servers and no uploads, and it works without an internet connection.

Can I convert a scanned PDF to Markdown?

Only if it has a text layer. PDF2MD extracts text from text-based PDFs, so scanned, image-only PDFs need to go through an OCR tool first.

Clean Text In, Better Answers Out

Converting PDFs to Markdown is one of the easiest ways to get more out of AI tools and notes apps. You remove the clutter, keep the structure, and use fewer tokens for the same content. It also makes your documents portable: one .md file works in ChatGPT, Obsidian, Notion, GitHub and most writing tools.

If you want to do it privately on your phone, without uploading anything, try PDF2MD and convert your next PDF before you paste it.

All articles
PDF2MD: PDF to Markdown

Private PDF to Markdown

Get App