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.

Quick answer

Drop a PDF, get a single HTML file with every page as positioned HTML. Edit in the editor first if you want.

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

Drop a PDF file here to convert it to HTML

or

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

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. The single external reference is a Google Fonts stylesheet link for standard families; offline, the page still renders with fallback type.

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 <text> inside real HTML text nodes, emits a single file, and never transmits the input.

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. Browser-first: under Node it
// needs jsdom, see /docs/html-export.
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. The one external reference is a Google Fonts stylesheet link, emitted for any standard font the design uses — so the file renders offline too, just with fallback type.

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: 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 every asset embedded, 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. The HTML exporter is browser-first — it renders through the DOM, so on a server you run it under jsdom, with some loss of text-measurement fidelity; the HTML Export docs cover the setup. 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