markdownfile conversionpandocweb to markdownai tools

Como Transformar um Arquivo em Markdown: What Actually Works for DOCX, PDF, HTML, and Web Pages

Zephyr Whimsy2026-11-156 min read

If you searched for "como transformar um arquivo em markdown" (how to turn a file into Markdown), the honest answer is: it depends on what kind of file you have. A Word document, a PDF, a saved HTML page, and a live web page behind a login each need a different tool.

I build Web2MD and convert content to Markdown most days, mainly to feed ChatGPT, Claude, and Cursor. This post is the routing table I use myself, including the cases where Web2MD is the wrong tool.

Why Markdown at all

There are three practical reasons:

  • It is plain text. It diffs cleanly in Git, opens in any editor, and will still be readable in 20 years.
  • AI models read it well. Headings, lists, and tables survive as structure, without the markup noise of HTML or the layout noise of PDF.
  • It is smaller. A web page saved as HTML carries scripts, styles, and navigation. The same content in Markdown is usually a fraction of the size, which matters when you pay per token or hit a context limit.

Pick the tool by file type

DOCX, ODT, EPUB: use Pandoc

Pandoc is the standard answer for document formats, and it deserves that reputation. It is free, runs offline, and handles headings, lists, footnotes, and tables. The command is pandoc report.docx -o report.md. If you want GitHub-style output, add -t gfm.

It has two limits. Complex Word layouts (text boxes, multi-column pages, merged table cells) do not map cleanly to Markdown, and images need the --extract-media flag or they are dropped as broken references.

PDF: use MarkItDown or a PDF-specific tool

PDF is the hardest case because a PDF stores positions of glyphs, not structure. There is no "heading" in the file, only bigger text. Microsoft's open source MarkItDown handles text-based PDFs reasonably, with markitdown report.pdf -o report.md. It also handles PPTX and XLSX.

Expect to clean up the result. Multi-column papers can interleave columns, tables often flatten into loose text, and scanned PDFs need OCR first. No tool I have tried gets PDF right every time.

Local HTML files: Pandoc again

For an .html file on disk, pandoc page.html -t gfm -o page.md works. The catch is that Pandoc converts everything in the file, including the nav bar, cookie banner, and footer. For a clean article you need something that extracts the main content first.

Live web pages: use a browser extension or a reader API

This is where most people actually end up. The "file" they want in Markdown is really a web page: a docs page, an article, a dashboard, a ChatGPT conversation. This is what Web2MD is for.

You open the page in Chrome, click the extension, and get Markdown of the main content. Navigation, ads, and sidebars are stripped out. A typical docs page comes out like this:

# Authentication

All API requests require a bearer token.

## Getting a token

1. Open **Settings** and select **API Keys**
2. Click **Create key**
3. Copy the key. It is shown only once.

| Header        | Value              |
| ------------- | ------------------ |
| Authorization | Bearer YOUR_TOKEN  |
| Content-Type  | application/json   |

Code samples on the page keep their fences and language tags, which matters if you are pasting into Cursor or Claude:

## Example request

```bash
curl https://api.example.com/v1/users \
  -H "Authorization: Bearer YOUR_TOKEN"
```

The response is a JSON array of user objects.

How Web2MD compares to Jina Reader, Firecrawl, and MarkDownload

These are good tools, and for some jobs they are better than Web2MD.

Jina Reader is the fastest way to convert a public URL. You prefix the URL with r.jina.ai/ and get Markdown back, with nothing to install. It is easy to call from a script.

Firecrawl is built for scale. If you need to crawl a whole documentation site into Markdown for a RAG pipeline, it is the right kind of tool. It needs an API key and is priced as a developer service.

MarkDownload is a free, open source browser extension with a long track record. It also runs in Firefox, which Web2MD does not.

Web2MD is different in four ways:

  • It runs in your browser, on the page you already have open. Jina Reader and Firecrawl fetch the URL from their servers, so they see what an anonymous visitor sees. For anything behind a login or a paywall you subscribe to, that means a login screen. Web2MD reads the page as rendered in your session, so internal wikis, paid newsletters, and account dashboards convert normally.
  • Privacy. Conversion happens locally. The page content is not sent to a third-party server to be converted.
  • Built-in token counter. You see the token count before you paste, so you know whether a page fits in the model's context. MarkDownload does not have this.
  • No API key, and one-click send to AI. There is a free tier with no setup, and a button that sends the Markdown straight to ChatGPT or Claude.

Where Web2MD falls short

  • Chrome only. There is no Firefox or Safari version. On Firefox, use MarkDownload.
  • 3 conversions per day on the free tier. That covers occasional use. If you convert pages all day, Pro is $9 per month. See the pricing page for details.
  • It is not a bulk crawler. It converts the page in front of you. For hundreds of URLs, use Firecrawl or a script around Jina Reader.
  • It is not a local file converter. For DOCX, use Pandoc. For PDF, use MarkItDown.

Quick decision table

| You have | Use | | ---------------------------------- | --------------------------- | | DOCX, ODT, EPUB | Pandoc | | PDF, PPTX, XLSX | MarkItDown | | Local HTML file | Pandoc with -t gfm | | Public URL, from a script | Jina Reader | | Whole site, at scale | Firecrawl | | Page behind a login or paywall | Web2MD | | Page you want to paste into an AI | Web2MD |

Tips that apply to every tool

  1. Check the tables. Tables are where converters most often fail. Compare at least one against the source.
  2. Check the code blocks. Lost indentation in Python or YAML silently changes the meaning.
  3. Count tokens before pasting. A long page can use a large share of a model's context, so trim sections you do not need.
  4. Keep the source URL. Add it at the top of the Markdown file so you can trace the content later.

Summary

There is no single tool for turning a file into Markdown. Use Pandoc for documents, MarkItDown for PDFs and Office files, a reader API for public URLs in scripts, and a browser-side converter for pages you are logged into or want to send to an AI.

If that last case is yours, you can install Web2MD and try it on a page you already have open. The free tier needs no account setup or API key, and three conversions a day is enough to see whether it fits your workflow. There are more conversion guides on the blog.

Related Articles

Most Read

last 30 days
  1. #1Can Claude Read Reddit? No — Here's the One-Click Fix (2026)
  2. #2HTML vs Markdown for LLMs: I Wasted 67% of My Tokens for a Year
  3. #3Reducing Token Waste in ChatGPT and Claude: 7 Techniques That Cut Costs 72%
  4. #4Obsidian Web Clipper Official Plugin 2026: Complete Guide + When You Need More
  5. #5Reddit JSON API vs Scraping: The Honest 2026 Comparison for Developers

Latest Articles