Prompting and practice · Read 8 min

How to convert a PDF or Word file to Markdown to use with AI

Converting PDF to Markdown is not a whim: an AI understands structure far better than a raw PDF. Here is the how, step by step.

Someone from the legal team hands you a forty page contract as a PDF and asks for a summary. You copy the text, paste it into your AI assistant and ask it to pull out the termination clauses. The answer comes back confident, but it invents a deadline, blends two sections and skips an entire table of penalties. It is not that the model is stupid. It is that you handed it a seamless brick of words, and it had to guess where one idea ended and the next began.

That is the problem solved by converting a PDF to Markdown before you give it to the AI. The PDF was designed so a human can read a printed page: it cares about where each letter lands on paper, not what it means. Markdown is the opposite: plain text with minimal marks that say "this is a heading", "this is a list", "this is a table". An AI does not see your document with eyes; it reads it as a sequence of text, and those marks are the signals that guide it. Giving it clean Markdown instead of a raw PDF is the difference between handing it a map and handing it a pile of streets with no names.

01 · the whyWhy clean Markdown matters to an AI

When you paste a PDF into a chat, underneath a library tries to extract the text and very often returns it in the order the letters appeared on the page, not the order in which they are read. A two column document gets interleaved. A header slips into the middle of a paragraph. The model receives that and, because it is trained to continue plausible text, fills the gaps with whatever sounds right. That is where half the hallucinations people blame on AI are born.

The AI does not read your document with eyes: it reads it as text. Structure is the only thing that guides it, and a raw PDF almost never keeps it.

Markdown solves this because it is explicit, lightweight structure. A # marks a heading, a - marks a list item, some vertical bars mark a table. The model recognizes those conventions because it saw them millions of times during training. When it receives Markdown, it no longer guesses the hierarchy: it reads it. It can tell that the "Penalties" section has three subpoints, that the table has five rows, that the loose sentence was a footnote and not part of the contract. It understands the shape, and with a clear shape it gets the substance right more often.

Figure 1 · the same content, two shapes
The same table from a document, as it usually ends up when you copy a raw PDF versus how it looks in structured Markdown.
Raw PDF (extracted text)Structured Markdown
Plan Date Price Basic 12/2025 9 Pro 12/2025 29| Plan | Date | Price |
(the cell order gets mixed, the AI cannot tell which price goes with which plan)| Basic | 12/2025 | 9 |
| Pro | 12/2025 | 29 |
On the left, the raw extraction melts the cells into a strip of words and the AI has to guess which number belongs to which row. On the right, the vertical bars tell it exactly where each cell starts and ends.

02 · the flowFrom any file to Markdown, step by step

The process, whatever the tool, always follows the same four chained steps. It is worth understanding them, because each one has its trap.

Step 1: identify what kind of file you really have. A PDF can be two very different things. If you can select the text with your cursor when you open it, it is a "text" PDF and the conversion will be clean. If the text is actually a photo of a page (a scanned document or a screenshot), there are no letters to extract: there are pixels. That case needs the extra step we will see in step 3. The same applies to images you upload: a photo of a whiteboard or a receipt is pixels, not text.

Step 2: extract the content while respecting the structure. Here the tool reads the file and pulls out not just the words but the hierarchy: what was a heading, what was a list, where there was a table. A good converter does not dump a flat stream; it rebuilds the shape. Word and PowerPoint are the friendliest, because they already store the structure internally. Excel and CSV turn into Markdown tables almost naturally. The PDF is the stubbornest, because its internal structure sometimes exists only visually.

Step 3: if it is scanned or an image, run it through OCR. OCR (optical character recognition) looks at the pixels and guesses which letters they are. It is the only way to get text out of a document that is, at heart, an image. It works very well with crisp printed text and worse with handwriting, stamps or crooked photos. This is the step where most errors sneak in, so it is worth reviewing the result with a critical eye.

Step 4: review and clean. No conversion is perfect on the first try. Check that the headings have the right level, that the tables have not broken, that no stray page numbers slipped in. Five minutes of review here save an hour of wrong AI answers later.

Conversion is not a magic button: it is four chained steps, and each one has a trap worth knowing before you trust the result.

Figure 2 · which formats are friendly and what to watch
Common source formats, how they behave when turned into Markdown and what to watch for.
Source formatEaseWhat to watch
Word (.docx)HighUsually comes out clean; check nested lists.
PowerPoint (.pptx)HighSlide order is kept; charts are not.
Excel (.xlsx) and CSVHighBecome tables; mind merged cells.
Text PDFMediumWatch two columns, headers and tables.
Scanned PDF or imageLowNeeds OCR; review the recognized text by hand.
The higher in the table, the less cleanup work. The real jump in difficulty happens between a text PDF and a scanned one: the second stops being text and becomes an image you have to interpret.

03 · the trapsThe two errors that ruin a conversion

Almost all the failures cluster in two cases. The first is the scanned PDF treated as if it were text. The person uploads it, the tool does not warn them that there are no letters to extract, and it returns an empty file or garbage. The warning sign is easy: if you cannot select the text in the viewer, you need OCR, no way around it. There is no shortcut.

The second is the table that falls apart. Tables are the nightmare of conversion because in a PDF they often do not exist as a table: they are text placed in positions that, to the eye, look like columns. The converter may read the cells left to right when they should go top to bottom, and then the price of the Basic plan ends up glued to the name of the Pro plan. With financial or technical data, that is not a cosmetic detail: it is an error the AI will propagate with full confidence.

The thirty second test

Before you give a document to the AI, open the converted Markdown and read it yourself first. If you, who know the content, take a while to tell where each section starts or which number goes with which row, the AI will take longer and get it wrong. Markdown that a human reads comfortably is Markdown the AI processes well. It is the best free check there is.

04 · in practiceHow Qirava solves it without you building the flow by hand

Everything above can be done by hand, chaining several tools: one to extract, another for OCR, another to clean. It works, but it is exactly the kind of mechanical work that piles up. Qirava integrates it into a single step: in Qirava Transcribe you upload the file (Word, PDF, Excel, PowerPoint, image or CSV) or paste a link (a YouTube, TikTok or Vimeo video, a recorded meeting, a WhatsApp voice note) and you get text and structured Markdown, with headings, lists and tables, not a brick of running words.

Here it is worth being exact, because honesty is part of the product. The voice engine runs on Qirava's own infrastructure: your content is not sent to third party APIs to be processed. On the free plan the transcriptions are not stored; the resulting text goes to your device and stays there under your control. The premium plan processes in batch (you upload many files and they are resolved together) and keeps what you convert for three months from its creation, with a notice before it expires, delivering it to a knowledge vault where your material stays ordered and searchable.

That is the deeper idea, and it is bigger than "convert a file". Qirava does not sell a loose feature: it integrates an AI layer with human judgment so the result is genuinely useful. The value is not in a button; it is in many pieces (extract, structure, transcribe, store, query) working together toward what you need: material ready for an AI to understand on the first pass.

The value is not in changing a file's extension. It is in the result being ready for the AI to understand on the first pass, without you building the flow piece by piece.

So the next time a forty page contract lands in your inbox, do not copy and paste it raw. Convert it to clean Markdown first. You hand the model a map instead of a maze, and the difference shows in the very first answer: fewer inventions, more precision, and an afternoon you did not lose fighting a summary that was wrong from the start.

Sources

  1. Gruber, J. (2004). Markdown: Syntax. Daring Fireball. Original specification of the Markdown language and its readable plain text philosophy. daringfireball.net/projects/markdown/syntax.
  2. Adobe. About PDF: Portable Document Format. Documentation on the fixed presentation purpose of the PDF format versus reusable content formats. adobe.com/acrobat/about-adobe-pdf.html.
  3. Smith, R. (2007). An Overview of the Tesseract OCR Engine. Proc. Ninth Int. Conference on Document Analysis and Recognition (ICDAR), IEEE. Technical reference on optical character recognition. github.com/tesseract-ocr/tesseract.

Learn more about AI

See all Learn AI