Why convert your documents to Markdown before feeding them to an AI
Cyrill Semah

Converting your documents to Markdown before feeding them to an AI directly changes the quality of what you get back: less layout noise, a format the model understands natively, and often a noticeably lower token bill. A raw PDF, Word file or scan carries a layout built for human eyes, not for a language model. Markdown strips that layer and keeps only what matters: headings, lists, tables, text.
What happens when you feed a raw document to an AI?
A PDF keeps headers, footers, multi-column layouts, and sometimes overlapping text. A Word file embeds internal markup the model has to untangle before it can read the actual content. A web page drags along scripts and HTML tags that add nothing to the reasoning.
The model doesn't guess what's signal and what's noise: it processes all of it, which dilutes useful context and inflates the token bill for a result that's often less precise. A table misread, a heading mistaken for a paragraph, and the generated answer inherits that confusion.
A concrete example: a pricing table split across a PDF's columns. Fed raw, a model often reconstructs the rows in the wrong order, because the visual layout and the reading order don't match. Converted to a proper Markdown table first, the same data comes out in the right order every time, because the structure is explicit instead of inferred from positioning.
Why Markdown is the format AI models understand best
Markdown is everywhere in the data language models are trained on: technical documentation, READMEs, wikis, notes. Its syntax is minimal (#, -, **), so it carries a lot of structure for very few tokens.
That structure also serves chunking in a RAG pipeline: headings mark natural boundaries, which produces coherent blocks instead of arbitrary cuts in the middle of a sentence. And because it's a readable text format, you can review, version and fix a converted document as easily as a code file.
How much does it actually change in tokens?
On a document that's already structured text (a clean Word file, a well-formatted export), the token gain is limited: the main benefit lies elsewhere, in normalizing to a single, predictable format.
On an image, a scan or a dense web page, the gap is real: converting back to clean Markdown after OCR is typically 2 to 7x lighter in tokens than letting a model process the image directly in vision mode. The full breakdown and method are in the guide on converting a scanned PDF to Markdown.
Which documents should you convert first?
Not every document is worth converting first. The ones that pay off fastest:
- Contracts and legal documents: structure matters here (clauses, numbered sections), and they're often re-read by an AI for a summary or a specific clause lookup.
- Invoices and accounting records: tables and amounts, where clean conversion to JSON avoids misreads.
- Meeting notes and reports: already close to Markdown once cleaned up, quick to index.
- Scanned reports and long PDFs: this is where the token savings show up most, once they've been through OCR.
- Email threads and exports: often ignored, but they carry decisions and context that are just as useful to an AI as a formal document, once the quoting and signature noise is stripped out.
Do you have to go through the cloud to convert your documents?
No, and that's often the real question for anyone handling sensitive documents day to day. Converting text files can run entirely locally, with no document ever leaving the machine. Only image OCR requires a network round trip, to the provider you choose, with your own API key.
For a profession bound by confidentiality constraints (legal, accounting, healthcare), that's the difference between a tool you can use on real case files and one you have to work around. The guide on converting confidential documents without the cloud covers exactly what stays local and where the limits are.
How to convert a document to Markdown with Sygal
Sygal converts 29 formats (17 document types: PDF, Word, Excel, PowerPoint, HTML, CSV, EPUB, email files, and 12 image formats) into clean Markdown or structured JSON, relying on MarkItDown for local conversion. The app includes a built-in Markdown editor, a local searchable library, and batch export over an entire folder.
For scripted workflows or agents, the Sygal CLI exposes the same conversion engine from the command line, with stable JSON output and documented error codes. Full feature details and a 14-day trial are available from the homepage.
The app runs on macOS 12 and Windows 10 or later, available in five languages (French, English, Italian, German, Spanish). One-time licence, no subscription, no usage limits: 14-day trial with no card required, and a 14-day money-back guarantee if the tool isn't a fit after that.
A concrete case: Markdown and RAG pipelines
Once your documents are normalized into clean Markdown and JSON, the next step is often indexing into a RAG pipeline: chunking, embeddings, retrieval. That's where upfront normalization pays off the most, because a single output format means you don't write a separate handler for every source type. The guide dedicated to preparing documents for a RAG pipeline covers the method in full.
The logic behind this blog
This is also the first article published here, and it sets the rule we're keeping going forward: every claim (token gains, local behavior, supported formats) is checked against Sygal's actual code or against cited public sources, never against a hunch. If a number changes, the article gets updated rather than quietly going stale.
If you want to see what this looks like on your own documents, the 14-day free trial is enough to test the conversion with no commitment, no card required. And if there's a specific topic you'd like covered (a format we don't handle yet, a particular use case), the contact page is the best way to tell us: real use cases usually make better articles than a topic picked in isolation.
Frequently asked questions
Because a PDF, a Word file or a scan carry a layout built for human eyes, not for a language model: headers, footers, columns, internal markup. Markdown strips that noise and keeps only the structure that matters (headings, lists, tables, text), which gives more reliable answers and often costs fewer tokens.
Try Sygal free for 14 days
Convert PDFs, images and Word docs into clean Markdown, locally on your Mac or PC. No cloud, no subscription.
Download SygalRelated articles

Convert a scanned PDF to Markdown for AI: cost and method
A scanned PDF or an image is expensive for an AI to read. Here's why, and how to convert it to clean Markdown to cut tokens on those specific cases.
Read the article
Preparing your documents for a RAG pipeline: clean Markdown and JSON
A RAG pipeline is only as good as the documents you feed it. Here's how to normalize any format into usable Markdown and JSON, locally.
Read the article
Converting confidential documents without the cloud: the 100% local method
Legal, accounting, healthcare: your documents shouldn't go to the cloud. Here's how to convert them to Markdown and JSON, 100% locally, and where the real limits are.
Read the article