Polotno

File converter

PDF to HTML converter

Convert PDF to a single HTML file in your browser. Layout preserved, text selectable, no asset folder to keep alongside it. Edit in the live editor before exporting.

Drop a PDF file here to convert it to HTML

or

Runs entirely in your browser. Your file never leaves your device.

Quick answer

Drop a PDF above and download a single HTML file: every page as positioned HTML, with selectable text and inline CSS. Edit in the editor first if you want.

Formula: PDF → Polotno JSON → positioned HTML (browser-only)

Ship a PDF's contents as a webpage without losing the layout. Drop the file above and get a single HTML file with every page rendered as positioned HTML. No asset folder, no plugin, no server.

One file, no asset folder

The output is one .html file. Every image is embedded as a data: URL and the styling is inline, so there is no asset folder to keep alongside it — you can email it, attach it to a ticket, host it on any static site, or drop it in S3. Fonts can load through Google Fonts stylesheets or custom URLs; offline, missing fonts use substitutes and can change the layout.

Layout-preserving, text still selectable

Elements are absolutely positioned inside one <div> per page, so positions and colors match the source PDF. Text runs come out as real text nodes, which keeps them selectable and copyable. For production accessibility or SEO, test the exported HTML in your own stack before publishing it.

Edit during conversion

As soon as the PDF parses, it loads into the live Polotno editor. Edit text, change colors, move blocks, drop in new images, then click Download HTML in the bar above the editor. Useful when a PDF is 90% of what you want as a webpage and needs one section reworked.

Turning a PDF into a web page

This is the most common reason people convert, and it comes with one caveat worth understanding before you start. What you get is a faithful web page, not a responsive website. Each PDF page becomes a fixed-size <div> whose elements are absolutely positioned, so it looks exactly like the original at any zoom level, on any browser. What it will not do is reflow: a two-column A4 layout stays a two-column A4 layout on a phone, because that is what the source document says it is.

For a great many jobs that is precisely right — publishing a report, putting a menu or a price list online, archiving a newsletter, attaching a rendered document to a ticket, or embedding a brochure in a page you already have. For those, fixed layout is a feature: nothing shifts, nothing breaks, and the result is one file you can host anywhere.

If instead you need a genuine responsive site built from the content of a PDF, no converter will give you that, here or anywhere. Reflowing a print layout into a fluid one is a design decision about what happens at every width, and that is authoring work rather than conversion. Use this to get the content and the exact layout out of the PDF, then rebuild the parts that need to be responsive.

How to convert PDF to HTML

Drop the file on the converter above. It parses in your browser via pdf.js, opens as an editable design, and downloads as one .html file when you click Download HTML. No account, no upload, no queue. Multi-page documents come out as one file with a <div> per page.

What to look for in a PDF to HTML converter

Most converters fail in one of three ways, and it is worth checking for each before you commit a document to one. They flatten the page to a bitmap, which kills selectable text and makes the file enormous. They split the output into an HTML file plus a folder of assets, which breaks the moment you email it. Or they upload your document to a server you do not control, which is a problem when the PDF is an invoice or a contract. This converter keeps text as real HTML text nodes, emits a single file, and never transmits the input.

Other ways to convert PDF to HTML

  • Adobe Acrobat: All tools > Export a PDF > Other format, then choose HTML. It tries to rebuild headings and paragraphs, so the text reflows but the layout drifts from the original.
  • Microsoft Word: open the PDF in Word, which converts it to an editable document, then File > Save As and choose Web Page, Filtered. Best for text-heavy documents with simple layouts.
  • pdf2htmlEX (open source, command line): pdf2htmlEX input.pdf writes a layout-faithful HTML file. The project is no longer actively developed (its last release is from 2020), so check that a build exists for your system before you plan around it.

Pick this page or pdf2htmlEX when the result must look like the PDF. Pick Acrobat or Word when you want flowing text and will tidy the layout by hand. If you only need a picture of each page, PDF to PNG is simpler.

The same conversion in code

pdf-to-html.ts
import { pdfToJson } from "@polotno/pdf-import";
import { jsonToHTML } from "@polotno/html-export";

const buffer = await file.arrayBuffer();
const json = await pdfToJson({ pdf: buffer });

// Returns the rendered HTML as a string — write it, serve it,
// or hand it straight to a response. For Node, use @polotno/html-export/node
// and install its @napi-rs/canvas and linkedom peers.
const html = await jsonToHTML(json);

Full API reference: PDF Import and the Import & Export overview (HTML export section).

How it works

  1. Step 1

    Drop the PDF

    Parsed in your browser by @polotno/pdf-import, which reads the PDF's operator stream rather than screenshotting the page. Nothing is uploaded.
  2. Step 2

    Edit first, if you want to

    The parsed design opens in a live editor. Retype text, change colours, drop in an image. Skip it entirely if the document is already what you want.
  3. Step 3

    Download one HTML file

    Click Download HTML in the bar above the editor. Each page becomes a positioned block of real text and embedded images, so there is no asset folder to keep alongside it.

Frequently asked questions

Q: What does the HTML output look like?

One .html file. Each page of the PDF becomes one <div> per page holding absolutely-positioned elements, with images embedded as base64 data URIs and all styling inline. No JavaScript is needed. Fonts can load through Google Fonts stylesheet links or custom font URLs. Offline, unavailable fonts use substitutes and may change the layout.

Q: Why HTML and not PDF text extraction?

Because HTML preserves layout. Plain-text extraction throws away positions, fonts, colors, images. The HTML this tool produces is easier to inspect, host, and copy from than a flattened bitmap export, while keeping the page layout visible in a browser.

Q: Is the text selectable?

Yes. Text comes out as real HTML text nodes, positioned to match the page, so it stays selectable, copyable and searchable. That's the difference vs. tools that flatten everything to a bitmap inside HTML.

Q: Can I edit the PDF before downloading the HTML?

Yes. That's the default flow. As soon as the PDF parses, it opens in the embedded Polotno editor. Tweak text, swap colors, move things, add new elements, then click Download HTML in the bar above the editor.

Q: Does the HTML use inline CSS?

Yes. Styling is written inline on the elements, and there is no separate stylesheet to ship. Font loading can use a Google Fonts stylesheet or custom font URLs. That makes the file easy to paste into a page you already have, at the cost of markup that is verbose and meant to be generated, not hand-edited.

Q: Does it work with scanned PDFs?

A scanned PDF holds a photo of each page and no text. It converts, but the HTML contains that same image, so nothing is selectable or searchable. Run the scan through OCR first if you need real text in the HTML.

Q: Can I convert a password-protected PDF?

Yes, if you know the password that opens it. The converter asks for it, unlocks the file in your browser, and converts as usual. Neither the PDF nor the password is sent anywhere.

Q: Can I convert several PDFs at once?

Not on this page. It converts one PDF at a time, and a multi-page PDF becomes one HTML file. For a batch, call the same two packages from a script: the snippet under "The same conversion in code" is the whole conversion.

Q: Can I turn a PDF into a website?

You can turn it into a web page, which is not quite the same thing. Every PDF page becomes a fixed-size block of absolutely-positioned elements that renders identically everywhere — right for publishing a report, a menu, a price list or a brochure. It will not reflow on a phone, because a two-column print layout has no responsive version to fall back to. If you need a genuinely responsive site, use this to get the layout and content out of the PDF, then rebuild the parts that need to adapt. No converter can make that decision for you.

Q: How do I convert a PDF to a web page online?

Drop the file above. It converts in your browser rather than on a server, so nothing is uploaded and there is no queue or account. You get one .html file with imported images embedded and possible external font references, which you can host on any static host, S3, GitHub Pages, or attach to an email. Multi-page PDFs stay a single file with one positioned block per page.

Q: Can I do this in JavaScript, in my own code?

Yes. The parsing half is a package you can install: @polotno/pdf-import turns the PDF into design JSON (it uses Mozilla's pdf.js underneath), which is exactly what this page does. The HTML half goes through @polotno/html-export's jsonToHTML too — this page reaches it via the editor store, and in your own code you call it directly. @polotno/pdf-import runs in the browser and in Node. For Node, use @polotno/html-export/node and install its @napi-rs/canvas and linkedom peers. That entry supplies the DOM parser and native canvas text measurement. The snippet is below under "The same conversion in code".

Q: How is this different from PDF to SVG?

PDF to SVG gives you raw SVG files, one per page, packaged in a ZIP if multi-page. PDF to HTML gives you one browsable file instead: each page becomes a positioned HTML block with real text nodes, which is easier to share with non-technical users and easier to host as a static page.

Q: Will the HTML render in every browser?

Yes for every modern browser: Chrome, Edge, Firefox, Safari and mobile Safari all render absolutely-positioned HTML with embedded data-URI images natively. No JavaScript runtime required.

Want this in your app? Embed Polotno SDK.

TRUSTED BY

100,000+

CREATORS

300+

BUSINESSES

ExpediaUnbounceLovePopPostGridPredis.ai