Skip to content
Jellykit

PDF to HTML

Turn the text of a PDF into a clean HTML page of headings and paragraphs, ready to edit or publish, with broken lines joined back up.

  • Runs on your device
  • Loads an engine on first use
Loading tool

About PDF to HTML

When the words of a PDF need to live on a web page, in a CMS or in an email, retyping them is slow and copying from a reader breaks every line in the wrong place. This tool reads the text layer, joins lines back into paragraphs, closes up words hyphenated at line ends, and marks text set clearly larger than the body as headings.

The result is one simple, standalone .html file per PDF with light styling you can delete. It is a starting point, not a facsimile: layout, columns, images, tables, links and fonts are not carried over, and scanned pages have no text to convert.

How it works

  1. pdf.js, loaded from this site on first use, reads every string each page draws, with its position and font size.
  2. Strings on the same baseline become lines. Lines of a similar size that sit close together become a paragraph; a change of size or a wider gap starts a new one.
  3. The size most of the text is set in counts as body text. Short blocks at least 15% larger become headings, the largest size h1, the next h2, the rest h3, consistently across the document.
  4. All text is escaped before it is written, so nothing in the PDF can add markup or script to the page.

Questions

Why is my layout not preserved?

The tool rebuilds the structure of the text, not the look of the page. Columns side by side are read straight across, and tables become paragraphs. For a picture of each page, use PDF to Images instead.

Why are some headings missed or some lines marked as headings?

Headings are guessed from font size alone. Headings set in bold at body size are not detected, and a short line of large text, such as a pull quote, may be marked as one. Turn headings off to get paragraphs only.

Is the HTML safe to open or publish?

Every piece of text from the PDF is escaped, and the file contains no scripts, links or external resources. It references nothing outside itself.

Does it work on scanned PDFs?

No. A scan stores pictures of pages, with no text to read. The tool tells you when it finds no text; Image to Text can recognise English print in page images.

Everything you enter here is processed in this browser tab. Nothing is uploaded, logged or shared. How privacy works here.