# Convert a PDF or Word file to Markdown

> Convert a PDF or Word file to clean Markdown in your browser, count its tokens and see what it costs to send to GPT, Claude and Gemini. Nothing is uploaded.

- Canonical: https://secondstack.ai/tools/pdf-to-markdown/
- Updated: 2026-11-18
- Price: free, no sign-up. Runs in the browser; nothing the visitor types or drops is uploaded.

---

Drop a file to get clean Markdown, its token count and what each model charges to read it. Your file is never uploaded.

**Privacy:** The conversion runs in your browser, and your file is never uploaded. The page loads only its own code from secondstack.ai and our analytics (Google Tag Manager, Google Analytics and Cloudflare Web Analytics), which never receive your file.

## What the converter does

### Markdown keeps the structure

Copying text out of a PDF loses the headings, flattens the tables and drags every page header along. Markdown keeps headings, lists and tables as they are, so a model can tell a rule from a caption. It is also plain text, so you can read what you are about to send.

### What converts and what does not

- **PDF with selectable text:** headings are recognized by size and weight, lists by their markers or indent, and tables by their columns. Pages set in two or three columns are read column by column. Rotated stamps and repeating page headers and footers are left out.
- **Word (.docx):** headings, lists, tables, bold, italic and links come from the document’s own styles.
- **Not yet:** images, scanned PDFs (they need OCR) and tables whose cells span several rows.

### How the token count works

The tool counts with the encoding OpenAI publishes, `o200k_base`, so the number is exact for the OpenAI models that use it. It does not run other vendors’ tokenizers, so their rows show a range labelled **estimate**. OpenAI’s tiktoken library does not yet name an encoding for the GPT-6 models, so their rows show this count labelled estimate too. Mistral is shown at the OpenAI count, because we found no published measurement.

### How many tokens is this in Claude?

It is more than the OpenAI count. No Claude tokenizer is public, so the tool uses published measurements: about 1.3 to 1.5 times the OpenAI count for documents and prose, and up to about 1.7 times for code. For Gemini the range is about 1.0 to 1.1 times for English text, measured on Gemini 3.x Flash. Sources, checked on 11 November 2026:

- [Anthropic, “Token counting”](https://platform.claude.com/docs/en/build-with-claude/token-counting): Claude 4.7 and later models use a newer tokenizer. The same input text produces approximately 30 percent more tokens than on earlier models.
- [Playcode, “The real price of frontier models”](https://playcode.io/blog/real-price-of-frontier-models): Measured with each vendor's counting endpoint on 16 fixtures, with the OpenAI count as 1.00x. Claude (new tokenizer): English prose 1.40x, HTML 1.36x, code 1.50 to 1.73x. Gemini 3.x Flash: English prose 1.01x, HTML 1.08x, code 1.16 to 1.23x.
- [Simon Willison, “Claude Token Counter, now with model comparisons”](https://simonwillison.net/2026/Apr/20/claude-token-counts/): The Opus 4.7 system prompt counts 1.46x its Opus 4.6 count.
- [Google, “Understand and count tokens”](https://aistudio.google.com/docs/tokens): For Gemini models, a token is equivalent to about 4 characters.

For an exact count, send the text to Anthropic’s token counting endpoint, `/v1/messages/count_tokens`, with your own API key and the model you plan to use, because the count differs between Claude models. This tool never sends your text anywhere, so it cannot make that call for you.

### What one run costs

Each row multiplies the token count by the model’s list price for input, from our [model price table](https://secondstack.ai/llm-pricing/). One run is a model reading the file once, and the table shows 1,000 runs. The model’s answer is billed separately, and caching or batch discounts would lower the cost.

### Where your file goes

It stays in your browser. The conversion and the count run there, and the link to this page never contains your text.

## Make a whole folder AI-ready and keep it in sync

Knowledge Collections in SecondStack take a folder of PDFs and Word files, convert it and keep it current as the files change. Your agents answer from that folder and show which document each answer came from. It runs with your own model providers.

## More free tools

- [Is this safe to paste into AI?](https://secondstack.ai/tools/safe-to-paste/): Mask names, bank details and keys first. Markdown: https://secondstack.ai/tools/safe-to-paste.md
- [What will AI cost your team?](https://secondstack.ai/tools/ai-cost-calculator/): A seat for everyone, or pay per use? Markdown: https://secondstack.ai/tools/ai-cost-calculator.md
- [AI usage policy generator](https://secondstack.ai/tools/ai-policy-generator/): A one-page policy in seven questions. Markdown: https://secondstack.ai/tools/ai-policy-generator.md
- [Compare two PDFs or Word files](https://secondstack.ai/tools/compare-pdf/): Every change between two versions. Markdown: https://secondstack.ai/tools/compare-pdf.md
- [Remove background noise from audio](https://secondstack.ai/tools/remove-background-noise/): Clean a recording in your browser. Markdown: https://secondstack.ai/tools/remove-background-noise.md
- [Transcribe audio to text](https://secondstack.ai/tools/transcribe-audio-to-text/): Text and subtitles from a recording. Markdown: https://secondstack.ai/tools/transcribe-audio-to-text.md

All free tools: https://secondstack.ai/tools/
