Convert a document
Open a file
Drop a PDF, DOCX, HTML, TXT or MD file here
Up to 30 MB. PDFs: the first 300 pages.
0 words · 0 characters · about 0 tokens (estimate: characters / 4)
Files are read and converted in this browser tab, never uploaded. The PDF reader (about 1.7 MB) and the Word reader (about 0.4 MB) load from this site only when you open that kind of file. Changing an option converts the same input again.
Why Markdown for LLMs
Markdown keeps a document's structure with very little markup: a # for a heading, a dash for a list item, pipes for a table. A model can see where a section starts and which lines belong to a list, and you spend your context window on the content instead of on tags.
The other ways in cost more. Raw HTML spends tokens on tags and attributes; the sample on this page is 1,108 characters of HTML and 678 characters of Markdown with the default options, with the same headings, lists, code block and table. Text copied out of a PDF loses its headings, splits words at line ends and repeats the running header on every page, which this converter strips.
What converts well and what doesn't
| Source | Comes through well | Check by hand | Not supported |
|---|---|---|---|
| PDF with a text layer | Headings (found by font size), paragraphs, bullet and numbered lists, words hyphenated across lines | Multi-column pages, footnotes, headings set in bold at body size | Tables (rows come out as lines), images, form fields |
| Scanned PDF | n/a | n/a | No text layer to read; OCR isn't supported |
| Word .docx | Headings that use Heading styles, lists, bold and italic, links, tables, footnotes | Headings typed as big bold text, text boxes, merged table cells | Comments, charts, equations, old .doc files |
| HTML file | Headings, lists, links, tables, code blocks with their language | Menus, sidebars and footers come through as text | Scripts, styles, forms and embedded frames are removed |
| Pasted rich text | Same as HTML: the clipboard carries the copied page's HTML | Pastes from apps that only copy plain text | Pasted image files |
| TXT and MD | Passed through unchanged, apart from line endings | n/a | n/a |
Embedded images in Word files and pasted content become a short placeholder, such as [Image: chart of sales], when you keep images. Images with a web address keep their link.
Privacy
Your file is read with the browser's File API and converted in this tab; there is no server step and no upload. The page counts conversions with Umami, recording only the file type (PDF, DOCX, HTML, paste or text) and whether it worked. File names and document content are never sent. See the site's privacy policy for the rest.
Frequently asked questions
Is my file uploaded anywhere?
No. The file is read and converted by JavaScript in your browser tab. The PDF and Word libraries are downloaded from this site the first time you open that file type, and no document content is sent back. Close the tab and nothing is kept.
Why is my PDF output empty?
The PDF is probably a scan: each page is a picture of text, with no text layer to read. The page tells you when it finds no text. OCR isn't supported here, so run the PDF through an OCR tool first (many PDF readers and scanner apps have one), then convert the result.
Does it keep tables?
From Word and HTML, yes: tables become GitHub-flavored Markdown tables, with the first row as the header. Merged cells are split into empty cells, and a line break inside a cell becomes a space. From PDF, no: a PDF stores text positions, not table cells, so table rows come out as plain lines.
How accurate is the token count?
It is an estimate: characters divided by 4, the rule of thumb OpenAI gives for English text. Real counts depend on the model's tokenizer. Code, numbers and non-English text, especially Chinese, Japanese and Korean, usually take more tokens than the estimate shows.
Can it convert .doc, Google Docs or Pages files?
Not directly. Save an old .doc file as .docx in Word or LibreOffice first. For Google Docs, use File, Download, Microsoft Word (.docx), or copy the text in the document and paste it into the paste box, which keeps headings, lists and links. Export Pages files to Word first.
Sources
Mozilla, pdf.js on GitHub: the PDF parser this page uses to read each page's text and its position and font size.
Michael Williamson, mammoth.js on GitHub: converts .docx to HTML from paragraph styles, which is why Heading styles matter.
Dom Christie, Turndown on GitHub and its GFM plugin: HTML to Markdown, including tables.
GitHub, GitHub Flavored Markdown Spec: the table syntax used in the output.
OpenAI Help Center, Understanding and counting tokens: one token is about 4 characters of English text, the basis of the estimate above.
Agents
Machine readable summary for AI assistants: