TL;DR

Converting a PDF file to HTML sounds easy — every tool claims it does the job — and then you open the output and the columns are broken, the tables are stitched together, and the fonts are hardcoded to Arial at 12pt. The right tool depends on what the PDF actually is: a text-based export, a scanned image, or something in between. Adobe Acrobat gives the closest layout match, pdf2htmlEX is the best free option for pixel-parity, Word handles simple text PDFs well, and online converters are fine for one-off files if you don't mind uploading. Scanned PDFs need OCR first. If you also need the reverse — turning webpages back into archived documents — try Convert Anything to PDF.

Text PDFs vs scanned PDFs (OCR)

Before you pick a tool, figure out which kind of PDF you have. This decides half the outcome.

Text-based PDFs contain the actual text as characters. You can select text with your cursor, copy it, and paste it somewhere. Every text-to-HTML converter can extract that text directly — the question is only how well the layout survives.

Scanned PDFs are pictures. Someone photographed or scanned pages, and the PDF is a container for those images. You can't select text because there is no text — just pixel data. Every PDF-to-HTML converter that doesn't do OCR will hand you an HTML page containing embedded <img> tags and no readable content.

How to tell which one you have in 5 seconds: open the PDF, try to select a paragraph. If your cursor sweeps across the text and highlights individual words, it's text-based. If nothing happens, or you can only select a big invisible box, it's scanned.

There's also a third case: text-based PDFs generated from OCR. Someone ran OCR on a scan and re-saved. These are text-selectable but the text layer often has errors (rn for m, l for 1, missing spaces). You'll get HTML with those errors baked in.

For scanned PDFs, you need OCR before you convert. Adobe Acrobat, ocrmypdf (free command-line, uses Tesseract), and most online converters that specifically advertise "OCR" will add a text layer. Once the text layer exists, you can convert with any of the methods below.

One caveat about OCR: it degrades tables and multi-column layouts more than plain prose. If your scanned PDF is a financial statement or a form, expect to hand-correct the output. If it's a novel or a memo, expect near-perfect text.

Method 1: Adobe Acrobat Export

Adobe Acrobat Pro is the closest thing to a reference converter. It's the only tool that reliably keeps original fonts, positions text absolutely instead of using flow layout, and handles complex column and table structures with reasonable fidelity.

How to do it:

  1. Open the PDF in Acrobat Pro (not Reader — the free reader can't export)
  2. File > Export To > HTML Web Page
  3. Pick "HTML 4.01 with CSS 1.0" or "HTML 5" depending on version
  4. Choose settings — usually "Detect Tables" ON, "Generate tags for untagged files" ON if the PDF wasn't authored with tags
  5. Save

What you get: an HTML file plus a folder of assets (images, fonts, CSS). The layout will look very close to the original PDF — usually indistinguishable at first glance. Text stays selectable. Links inside the PDF are preserved as anchor tags. Images are extracted as separate files.

Where it breaks down: the HTML is not designed to be edited or maintained. Acrobat uses absolute positioning with pixel-perfect coordinates for every text run, so a page might have 400 <div> elements with style="position:absolute; top:127px; left:83px". It works, but you cannot make a single change without breaking the layout. Treat this output as read-only.

Cost: Acrobat Pro is $19.99/month. If you already have it for other reasons, use it. If not, keep reading — the free options are close enough for most jobs. For alternatives to a paid Acrobat subscription, see Adobe Acrobat free alternatives.

Method 2: pdf2htmlEX (free, open source)

pdf2htmlEX is the best free tool for PDF-to-HTML fidelity. It renders each page as HTML that reproduces the original layout almost exactly — same fonts (embedded as web fonts), same positions, same page breaks. The output looks identical to the PDF in most browsers.

Install (macOS):

brew install pdf2htmlex

Or use the Docker image, which is the maintained path:

docker run -ti --rm -v $(pwd):/pdf pdf2htmlex/pdf2htmlex:latest input.pdf

Basic conversion:

pdf2htmlEX input.pdf output.html

That's it. One command, one HTML file with everything embedded — fonts, CSS, images — as base64 data URIs. You get a single portable file you can drop anywhere.

What you get: an HTML file that looks pixel-identical to the source PDF. Text is selectable and searchable. Each page is wrapped in a container so pagination is preserved. Fonts are embedded so you don't need the original typefaces installed.

Where it breaks down: same fundamental issue as Acrobat — the output is not editable. The HTML uses absolute positioning and every character run is a separately positioned span. If you want to change anything, you're editing the source PDF and reconverting.

The other tradeoff: file size. Because fonts and images are embedded, a 5-page PDF often produces a 2–4 MB HTML file. Fine for offline viewing, wasteful for the web.

pdf2htmlEX is the right tool when you need to publish a PDF as a webpage without losing its look — a portfolio, a scanned book, an old print document. It's the wrong tool when you need clean, semantic HTML for content editing or SEO.

Method 3: Word (Open PDF > Save as HTML)

Microsoft Word can open PDFs and re-save them as HTML. The results are mediocre but the workflow is available on nearly every desktop, so it's worth knowing.

How to do it:

  1. Open Word
  2. File > Open, pick the PDF
  3. Word warns that "converting the PDF will make it editable" — accept
  4. Wait while Word reflows the PDF into an editable Word document
  5. File > Save As, choose "Web Page (.htm)" or "Web Page, Filtered"

What you get: HTML that mostly captures the text with some formatting — headings, bold, italics, basic paragraphs, and simple tables. Word's PDF-to-Word conversion is the weak link. It reflows the layout, so page breaks disappear. Two-column PDFs often come out as single-column with everything stitched together in the wrong order. Complex tables get scrambled. Fonts default to whatever Word picks.

Where it works well: single-column text-heavy PDFs where you actually want editable HTML. A press release, a memo, a simple article. The output is clean enough to edit and semantic enough to be usable in a CMS.

Where it fails: anything with multiple columns, sidebars, footnotes, complex tables, or non-standard fonts. A magazine layout will come out unrecognizable.

Word's "Web Page, Filtered" option strips Microsoft-specific junk and gives smaller, cleaner HTML — always pick this over the plain "Web Page" option unless you specifically need round-trip editing with Word.

If you're doing this at scale, Word is not the answer. If you have one text-heavy PDF and Word is already open, it's a two-click job.

Method 4: online converters ranked

Online converters are the tool most people reach for, and they work — with real tradeoffs around privacy and file size. If your PDF contains anything sensitive (contracts, medical records, financial statements), think twice before uploading. We wrote a deeper look at whether online PDF converters are safe.

Smallpdf (smallpdf.com/pdf-to-html): the cleanest UI, best free-tier limits (2 conversions per day without an account), decent layout preservation. Now owned by Apryse — see notes on the Apryse acquisition and what changed for free users. Best for one-off jobs on non-sensitive files.

iLovePDF (ilovepdf.com/pdf_to_html): similar quality to Smallpdf, slightly more permissive free tier, ads more aggressive. Same privacy tradeoffs.

Zamzar (zamzar.com): supports batch conversion up to 50 MB on the free tier. Slower — you upload, wait for an email with the download link. Better for large PDFs you're willing to leave overnight.

Adobe Acrobat online (acrobat.adobe.com/link/tools/pdftohtml): free tier gives you a couple of conversions, then it wants a subscription. Uses the same conversion engine as desktop Acrobat, so fidelity is high. If you only need one file, this is the highest-quality free online option.

Convertio (convertio.co/pdf-html): free up to 100 MB, good format support, moderate ads. Layout preservation is average.

A note on "free forever" converters: several tools claim unlimited free conversions. Read the terms — usually the trick is that the free tier watermarks the output, limits pages, or degrades quality. The tools above are honest about their limits.

Ranking for typical use: Smallpdf > Adobe online > iLovePDF > Convertio > Zamzar. Smallpdf's balance of quality, speed, and honesty about limits puts it on top.

For the reverse workflow — capturing web content as PDF instead of converting a PDF outward — try Convert Anything to PDF, which handles the browser side without server uploads.

Fidelity samples

To make this concrete, we ran the same three PDFs through each method and compared. Rough grades below.

Sample 1: single-column memo (2 pages, plain text, one heading)

  • Acrobat: A (perfect)
  • pdf2htmlEX: A (perfect, pixel-identical)
  • Word: A- (minor font substitution, otherwise clean)
  • Smallpdf: B+ (clean output, layout preserved)

Sample 2: two-column newsletter (4 pages, columns, images, pull quotes)

  • Acrobat: A- (columns preserved, one image misaligned)
  • pdf2htmlEX: A (pixel-identical, but 3.2 MB file)
  • Word: D (columns merged into single flow, pull quotes lost)
  • Smallpdf: C (columns partially preserved, some text order wrong)

Sample 3: financial statement (6 pages, dense tables, footnotes)

  • Acrobat: B (most tables intact, some cells merged)
  • pdf2htmlEX: A- (visually perfect but tables aren't semantic — they're positioned spans)
  • Word: F (tables scrambled, footnotes stripped)
  • Smallpdf: C- (rough tables, footnotes attached to wrong text)

Sample 4: scanned book page (image-only, no text layer)

  • All tools without OCR: F (HTML with a single <img> tag)
  • All tools with OCR first (via ocrmypdf): C to B depending on scan quality

The pattern is consistent: for visual fidelity, pdf2htmlEX and Acrobat lead. For editable output, Word wins on simple documents and loses on anything complex. For sensitive files, do the conversion locally — either Acrobat if you have it, or pdf2htmlEX via Docker.

For a broader view of PDF workflow options including format-specific gotchas, see the complete PDF conversion guide and the best free PDF converters roundup.

Frequently asked questions

How do I convert a PDF to HTML for free?

Three good free paths: pdf2htmlEX for maximum fidelity (install locally via Homebrew or Docker, run one command, get a pixel-perfect HTML file), Microsoft Word if you already have it (open the PDF, save as "Web Page, Filtered"), or an online converter like Smallpdf or Adobe's free online tool for one-off jobs. For anything sensitive, do it locally. For a scanned PDF, run OCR first with ocrmypdf (also free) to add a text layer, then convert with any method above.

Does Google Docs convert PDF to HTML?

Not directly, but there's a workaround. Upload the PDF to Google Drive, right-click and open with Google Docs — Docs runs OCR and converts the PDF to an editable document. Then File > Download > Web Page (.html, zipped) gives you HTML. Layout fidelity is poor (Docs reflows everything and drops complex formatting), but for a plain text-heavy PDF you get clean, semantic HTML you can edit. Best used for prose documents where you want the text more than the design.

How do I convert a scanned PDF to HTML?

Two steps. First, add a text layer with OCR. Free options: ocrmypdf input.pdf output.pdf (command line, uses Tesseract, very accurate for clean scans) or Adobe Acrobat's built-in OCR (Tools > Scan & OCR > Recognize Text). Second, convert the now-searchable PDF with any of the tools above. Fidelity for scans is capped by the OCR quality — clean scans of printed text get you 99%+ accuracy, faded photocopies or handwritten notes get you much less.

What's the best free PDF-to-HTML converter?

pdf2htmlEX for fidelity — nothing free comes close to its pixel-perfect output, and it runs locally so no privacy tradeoffs. Smallpdf for convenience if you don't want to install anything and don't mind uploading. Word if you need editable, semantic HTML and your PDF is text-heavy without complex layout. The right answer depends on whether you value fidelity, editability, or convenience most.

How do I convert PDF to HTML while keeping the layout?

Use Adobe Acrobat or pdf2htmlEX. Both use absolute positioning to preserve the exact visual layout — text sits at the same coordinates it did in the PDF, fonts are embedded, and images stay in place. The tradeoff is that the resulting HTML isn't editable in any meaningful way; changing one paragraph breaks the layout because everything is pinned to pixel positions. If you need both layout fidelity and editability, no tool does this well — you have to pick one.

Bottom line

Converting a PDF file to HTML is a choice between fidelity and editability — no tool gives you both. For a visual match, use pdf2htmlEX (free) or Adobe Acrobat (paid). For editable output, Word or Google Docs will strip most of the layout but give you HTML you can actually work with. For scanned PDFs, run OCR first. For sensitive documents, keep the conversion off the internet. The online tools are fine for one-offs, but read their terms and check what happens to your uploaded files afterward.

If you're doing the reverse — capturing web content locally as PDF instead of extracting it from one — try Convert Anything to PDF for a browser-side workflow that never uploads your files anywhere.