How to Convert TXT, Markdown or HTML to PDF in Your Browser
Published on August 17, 2026
You can turn a .txt, a .md or a saved HTML page into a PDF in three steps, free, in your browser. See which tool to use and what each PDF keeps.
How to convert TXT, Markdown or HTML to PDF
To convert text, Markdown or HTML to PDF, open the tool for your format, upload the file and click "Convert and download". Plain text becomes a paginated A4 PDF; Markdown becomes a formatted PDF with headings, lists, tables and code; HTML becomes a PDF that reproduces the look of the page. Everything runs in your browser, with no sign-up and without sending the file to any server.
The right choice depends on what you have and what you need afterward. The three converters share the same button and the same flow, but the results differ: two of them deliver live text you can select and search; the third delivers a faithful snapshot of the page. If your file is JSON or YAML, that is a different path: see how to convert JSON or YAML to PDF.
Step by step to convert to PDF
- Open the tool that matches your file: "Convert text to PDF" (.txt), "Convert Markdown to PDF" (.md or .markdown) or "Convert HTML to PDF" (.html or .htm).
- Upload one or more files; each one becomes a separate PDF.
- Click "Convert and download" (with several files the button reads "Convert N files"). Each PDF downloads with the original file name and the .pdf extension.
The text converter takes a .txt and lays it out on A4 pages, with 11-point type, fixed margins and automatic line wrapping. The text stays selectable and searchable in the PDF. There are no font, size or paper options: it is the fastest way to turn a note, a draft or a simple log into a document. A file with no text (only spaces or blank lines) is rejected with the warning "The text file is empty."
Markdown to PDF: what the formatting keeps
If your content has headings, lists or code snippets written in Markdown, use the Markdown converter so that structure shows up formatted in the PDF instead of becoming running text full of symbols. The PDF comes out in A4, with selectable, searchable text. For a PDF with code highlighting and more polish, there is the high-fidelity version, which runs on our server: see how to convert scanned PDFs, Word and tables to Markdown.
- Kept: headings at several levels, paragraphs, bulleted and numbered lists, code blocks in a monospaced font, quotes, tables, horizontal rules, bold and italic.
- Images: they only go in if they are embedded inside the .md itself, as PNG or JPEG written into the file as text (the base64 format). Linked images, such as  or a web address, are left out without warning.
- Links: only the link text goes into the PDF; the address does not appear and nothing is clickable. Strikethrough text comes out as plain text.
- File with no text: the tool warns "The Markdown file is empty."
HTML to PDF: faithful look, but the text becomes an image
The HTML converter works differently. First it cleans the page: any code that could run is removed. Then it takes a high-resolution snapshot of the page and slices it into A4 pages. The result keeps the look, with text, images, tables and styles in place, and is great for reading and printing. The trade-off: the text in the PDF cannot be selected, copied or searched, because it became an image. If you need live text, convert the content to text or Markdown first.
- Goes into the PDF: whatever is inside the HTML file, including embedded images and styles written in the page itself.
- May not appear: images and styles the page fetched from the internet when it was saved.
- Does not go in: anything that depends on scripts, such as content loaded after the page opens.
- Form fields, buttons and drop-down boxes are removed along with the scripts; the text around them stays.
- File with nothing visible: the tool warns "This file has no visible content to convert."
Text, Markdown or HTML: which converter to pick
- Text file (.txt): "Convert text to PDF". Ideal for notes, memos and unformatted content; the text stays searchable.
- Markdown (.md): "Convert Markdown to PDF". Keeps headings, lists, tables, code and emphasis; the text stays searchable.
- Saved web page (.html): "Convert HTML to PDF". Preserves the exact look, but the text becomes an image.
- In every case: an A4 PDF that opens the same on any device, without uploading anything to a server.
Why send a PDF instead of the original file
A .txt can open with different fonts and line breaks in each program; a .md looks full of symbols to anyone without a Markdown editor; and a loose HTML file loses images and styles when opened on another computer. The PDF locks the look and the pagination, so the document arrives exactly as you saw it when you converted it. For Word, Excel and PowerPoint, see how to convert Word, Excel and PowerPoint to PDF.
Limits that apply to all three
In the text PDF, characters outside the Latin alphabet, such as Chinese, Japanese, Arabic and emoji, show up as "?". In the Markdown PDF, they simply disappear, without warning. The reason is the same in both: the embedded font only covers the Latin alphabet with accents. Common symbols such as arrows and greater-or-equal signs are swapped for readable equivalents. This does not happen in the HTML PDF, because the page is photographed as the browser shows it. None of the three offers paper size, margin or font options.
Everything happens in your browser: your file is never sent to any server.
If your text has characters outside the Latin alphabet, prefer converting through HTML: the result is not searchable, but every character shows as it does on screen.
