UseToolSuite UseToolSuite

Markdown, HTML & Text to PDF

Convert Markdown, HTML or plain text to PDF or Word in your browser. Plain text exports as real selectable PDF text, not a page image — and this page explains why.

Inputs: Markdown, HTML, plain text Outputs: PDF, Word (.docx) Text fidelity: Selectable text from plain-text input Processing: 100% client-side
0 words · 0 chars
.pdf
Ctrl+Enter to export

Preview will appear here as you type...

Markdown and HTML are laid out by the browser and captured as page images, so the PDF matches the preview exactly but its text is not selectable or searchable. Plain text is drawn with the PDF's own font engine instead — the output is smaller and the text stays selectable, searchable, and copyable.

Three inputs, two rendering paths

Markdown and HTML take the same route: the input is turned into styled HTML, the browser lays it out, and html2canvas captures the result, which jsPDF then places on pages as images. That is why the PDF matches the live preview pixel for pixel — and why its text cannot be selected or searched.

Plain text takes the other route. There is no layout step at all: jsPDF writes the characters directly using one of the three fonts built into the PDF format, so the output keeps real text and is usually several times smaller for the same content. The font, line-height and alignment controls appear only in that mode because they are the only mode that reaches the font engine.

Supported Markdown syntax

  • Headings — # H1 through ###### H6
  • Emphasis — *italic*, **bold**, ***bold italic***, ~~strikethrough~~
  • Lists — unordered (-, *, +) and ordered (1. 2. 3.)
  • Code — inline `code` and fenced ```code blocks```
  • Tables — GFM syntax with | and ---
  • Links & images — [text](url) and ![alt](src)
  • Blockquotes — > quoted text, multi-line aware
  • Horizontal rules — --- or ***

Picking the right mode

  • A README or spec you want to hand to a client — Markdown, exported to PDF.
  • An invoice or report someone must edit afterwards — any mode, exported to Word (.docx).
  • Logs, meeting notes, or anything that must stay searchable — plain text, so the PDF keeps selectable characters.
  • Markup you already have styled — HTML, with your styles inline or in a <style> block.

Check whether your last converted PDF has real text

Open any PDF a browser-based converter produced for you and try to select a sentence. If the cursor draws a box around the whole page instead of highlighting words, the text is not text — it is a picture of text. It will not be searchable with Ctrl+F, it cannot be copied, a screen reader cannot read it, and the file is far larger than it needs to be.

This is not a rare defect. It is the normal outcome of how nearly every in-browser Markdown-to-PDF converter works, and almost none of them mention it.

Why it happens, and when it is the right trade

There are only two ways to put content on a PDF page from a browser, and they have opposite properties.

The layout route hands your content to the browser’s own rendering engine, screenshots the result with html2canvas, and places those screenshots into the PDF as JPEG images. Everything the browser can lay out — nested tables, floats, inline styles, web fonts, background colours — survives exactly as you saw it in the preview. Nothing that arrives is text any more.

The text route skips layout entirely and writes characters directly into the PDF’s content stream using one of the three fonts built into the format. The output stays selectable, searchable, copyable and small. The cost is that there is no CSS: no tables, no images, no colour, one font at one size.

This converter uses both, chosen by input type. Markdown and HTML take the layout route, because a Markdown table that lost its borders would be a worse outcome than one you cannot select. Plain text takes the text route, because a meeting note or a log excerpt has no layout to preserve and every reason to stay searchable.

The size difference is not subtle. Exporting the plain-text sample on this page produces a PDF just under 4 KB carrying a native Helvetica font reference and no image objects at all. The same content through the layout route arrives as a full-page JPEG at 2× scale — a different order of magnitude for identical words.

Picking the route deliberately

The input selector is the lever, so it is worth using on purpose rather than by whichever format your source happens to be in:

  • Paste as plain text when the document will be searched, archived, indexed, fed to another tool, or read by assistive technology. Contracts, notes, logs, transcripts, anything going into a document management system.
  • Paste as Markdown or HTML when the visual result is the point — a README going to a client, a formatted report, anything with tables or images where losing layout would be worse than losing selectability.
  • Export to Word instead when the recipient needs to edit. That path produces a real .docx with actual paragraph and heading styles from any of the three inputs, and sidesteps the whole question.

If you need both fidelity and selectable text, no browser-only tool will give it to you — that requires a real PDF typesetting engine (LaTeX, Prince, WeasyPrint) running server-side, which means uploading the document. That is a genuine trade, and worth knowing before you assume a converter is simply broken.

Two things that surprise people about the layout route

External images need CORS. The canvas that captures your content cannot read pixels from an image served without permissive CORS headers — the browser taints it and the capture fails or comes back blank. Base64 data: URIs always work because nothing is fetched. Relative paths like ./diagram.png can never resolve, since there is no document directory in this context.

Web fonts do not embed. Only the three PDF base fonts — Helvetica, Times, Courier — are guaranteed present. A @font-face or Google Font renders in the preview, gets captured as pixels on the layout route, and is silently substituted on the text route. If typography matters to the output, check the exported file rather than the preview.

Last updated Built and maintained by Necmeddin Cunedioglu How tools are tested

How helpful was this tool?

Click to rate

Key Concepts

GFM (GitHub Flavored Markdown)

An extension of standard Markdown used by GitHub that adds tables, task lists, strikethrough, and fenced code blocks with a language tag.

Rasterised vs native PDF text

A rasterised PDF stores the page as an image: it looks exactly like the source but cannot be searched or copied, and grows with page count. A native-text PDF stores the characters plus a font reference, so it stays small and machine-readable. This tool produces the first from Markdown/HTML and the second from plain text.

Frequently Asked Questions

Why is the text in my PDF not selectable?

Because of how the input was rendered. Markdown and HTML are laid out by the browser and captured as page images, so the PDF reproduces the preview exactly but every glyph is part of a picture. Plain-text input takes a different path — jsPDF draws the characters itself — so that output stays selectable, searchable, and copyable, and the file is typically several times smaller. If you need selectable text, paste as plain text.

What Markdown syntax is supported?

Headings (# through ######), bold (**), italic (*), bold italic (***), strikethrough (~~), inline code (`), fenced code blocks (```), unordered and ordered lists, GFM tables, blockquotes (>), links, images, and horizontal rules (---).

Can I use custom CSS in HTML mode?

Inline styles and a <style> block inside the input are honoured; a print-optimised stylesheet is applied on top. External stylesheets loaded through <link rel="stylesheet"> are ignored, because the renderer never fetches them.

What page setup options are available?

A4, Letter, and Legal in portrait or landscape, margins from 10 to 25 mm, and a base font size from 9 to 14 pt. Plain-text mode adds font family (Helvetica, Times, Courier), line height, and text alignment, since those settings reach the PDF font engine directly.

Which Markdown features survive the conversion to PDF?

Standard Markdown renders faithfully: headings, bold/italic, ordered and unordered lists, links, blockquotes, fenced code blocks with monospace formatting, and pipe tables. The PDF applies a clean print stylesheet so the result looks like a typeset document rather than raw markup. Niche extensions — diagrams, footnotes, or HTML embedded in the Markdown — may render partially depending on syntax.

How do I keep code blocks from overflowing the page edge?

PDF pages have a fixed width and can't scroll, so very long code lines are the main thing to watch. Wrap or break long lines in the source before converting, or choose a smaller base font so more characters fit per line. Tables behave the same way — switch to landscape orientation if a wide table is getting clipped.

Troubleshooting & Technical Tips

External images missing from the output

Remote images must be readable by the canvas renderer, which requires CORS headers. Use base64 data: URIs for guaranteed inclusion, or serve the image from a CORS-enabled origin. Relative paths such as ./image.png can never resolve — the browser has no file-system context here.

Web fonts (Google Fonts, @font-face) not rendering

Only the standard PDF base fonts (Helvetica, Times, Courier) are embedded. Web fonts are not bundled into the output; the nearest base font is substituted.

Unicode characters (CJK, Arabic, emoji) render as boxes

This affects plain-text mode only, because the PDF base fonts cover Latin-1 alone. Non-Latin scripts appear as boxes. Switch to Markdown or HTML mode, where the browser rasterises the text with a font that has the glyphs.

Table columns overflow the page width

Switch to landscape, reduce the base font size, or split wide tables. PDF pages have a fixed width and cannot scroll, so anything past the margin is clipped rather than wrapped.

Line breaks not preserved in plain-text mode

The input needs real newline characters, not soft wraps. Rich-text editors sometimes strip explicit breaks on copy — paste as "Unformatted Text", or paste through a plain-text editor first.

Related Guides

Related Tools

Embed this tool on your site

Paste this snippet into any HTML page or blog post to embed a live, fully working copy of Markdown, HTML & Text to PDF. Free for any use.