tools / convert a document / pdf to html

PDF to HTML

A pixel-faithful copy of the page whose text is fitted to it, reviewable run by run before export.
Runs locally in your browser. Enable JavaScript to use the interactive tool. The practical details remain available below.

What PDF to HTML actually does

There are two honest ways to turn a PDF into a web page and they answer different questions. A reflowed conversion throws the layout away and gives back headings and paragraphs that resize with the window, which is what an article wants. A faithful conversion keeps the page exactly as it was drawn and lays the real words over the top of it, which is what a form, a certificate, a statement or a designed layout wants, because in those documents the position of a number is part of its meaning. This page does the second. Every page is drawn once as a picture and every text run from the source is placed over it as a transparent, selectable, copyable HTML element. What usually goes wrong with that approach is that the invisible words drift away from the visible ones, so selecting a line highlights half of the line above it. Two things stop that here: each run is placed from its own baseline minus the ascent of the actual font the PDF embedded, rather than from the bottom of a line box, and each run is stretched horizontally until it is exactly as wide as the source said it was. The fit is shown as a number for every run, so the claim can be checked rather than believed.

How to use it

  • Choose a PDF. It is opened in this tab and the page count is read before anything is converted.
  • Choose what the page should carry. A PNG picture for a designed page, a JPEG one for a scan, or no picture at all when only the text and its positions matter. Resolution, JPEG quality, font embedding and a page range are all decisions here, and each one is reflected in the byte breakdown of the result.
  • Convert, then review. The converted page renders beside the list of text runs that produced it. Selecting a run outlines it in the page and shows the size, the position, the width the source reported, the width this font renders, and the fit that was applied.
  • Retype anything that came through wrong, then download the HTML. A retyped run keeps its position and drops its stretch, because the width the source reported belonged to the words that were replaced.

Useful for

  • Put a designed one-page document, a certificate or a statement on the web without losing its layout and without turning it into an image nobody can search or copy from.
  • Make a PDF's text selectable and copyable in a browser while the page still looks like the original.
  • Check whether a converter's text layer actually lines up with the page, by reading the fit for each run rather than by dragging the cursor over it.

Limits worth knowing

  • The picture is the picture. Images, charts, logos and vector drawings stay inside the page raster and are not extracted as separate files.
  • Hyperlinks, form fields, annotations and bookmarks are not carried across.
  • A table stays a visual grid rather than becoming table markup. A spreadsheet is what the CSV and Excel conversions are for.
  • Rotated and vertical text is positioned but not rotated, so a sideways caption sits horizontally over its own artwork.
  • Embedding the fonts a PDF used carries the whole font program, not a subset, so a document that uses several faces produces a large file. Font embedding can be switched off, at the cost of the fit falling back to the metrics the source declared.
  • A scanned page holds no text, so it converts as a picture with nothing to select or retype, and says so.

Questions people ask

Is the file uploaded?

No. It is read, drawn and assembled inside this tab. Nothing leaves the browser.

Why is the text invisible in the result?

It is transparent on purpose. The picture already shows the words at full fidelity, so drawing them twice would blur them. The transparent copy is what makes the page selectable, copyable and searchable.

What does the percentage next to each run mean?

How far that run had to be stretched horizontally to match the width the source reported for it. A small number means the embedded font renders the run almost exactly as the PDF drew it.

Why is the file so large?

A faithful page carries a picture of every page and, by default, the font programs the PDF used. The result names the byte cost of each, so the resolution, the codec and the font decision can each be traded off against it. Text only with no picture is a few kilobytes.

When is the reflowing conversion the better answer?

Whenever the document is prose meant to be read on a phone. A faithful page keeps a fixed layout, so it scales but never reflows.