Home › PDF Tools › PDF to HTML

PDF to HTML

Turn a PDF into a web page. Choose clean text-flow HTML with real headings, paragraphs, lists and tables that reflows on phones, a positioned layout that keeps every line where it was, or an exact look with the page picture under a selectable text layer. Preview it, then download the .html file.

Open a PDF to convert it to HTML.

The converted web page is previewed here, exactly as it will look when you open the downloaded .html file.

Advertisement
Advertisement

How to use the PDF to HTML

  1. Open your PDF by dropping it into the box or clicking to choose it.
  2. Pick the layout: Text flow for content you want to edit or publish, Positioned layout to keep the page design, Exact look for a pixel-perfect copy.
  3. Adjust the options, such as which elements to detect or the page range, for example 1-5.
  4. Check the Preview and the HTML code tab.
  5. Download .html or press Copy HTML to paste the code into your editor or CMS.

Text flow, positioned layout or exact look?

Text flowPositioned layoutExact look
Looks like the PDFNo, clean web stylingClose: same positions and sizesIdentical
Responsive on phonesYes, text reflowsNo, fixed page widthNo, fixed page width
Easy to editYesHard (one element per text run)Hard
Images and graphicsNot includedNot includedIncluded as page pictures
Searchable, selectable textYesYesYes (invisible text layer)
Typical file sizeSmallestSmallLargest (about 100 to 400 KB per page)
Best forWebsites, blogs, CMS, accessibilityForms, flyers, archived layoutsBrochures, scans, design proofs

How the conversion works

PDF text is stored as runs of characters with an exact position, a font and a size. For Text flow, runs are grouped into lines, lines into paragraphs, and larger fonts become headings: the font size used for most of the text is the body size, and sizes clearly above it map to <h1> to <h5>. Bullet and number markers become <ul> and <ol>, and aligned rows with wide gaps become a <table>.

For the positioned modes, every run becomes an absolutely positioned <span>. A PDF point is 1/72 inch and a CSS pixel is 1/96 inch, so coordinates are multiplied by 96 ÷ 72 = 1.333; a US Letter page (612 × 792 pt) becomes a 816 × 1056 px box. Each span is stretched horizontally with scaleX() so that the web font covers exactly the same width as the original text.

Want Markdown instead of HTML? Use PDF to Markdown. Going the other way? HTML to PDF turns a web page into a PDF.

Frequently asked questions

How do I convert a PDF to HTML for free?

Open the PDF on this page, choose a layout and the HTML is generated in a few seconds. Press Download .html to save it or Copy HTML to paste the code elsewhere. There is no sign-up and no upload.

Which layout should I choose?

Text flow produces clean, responsive HTML that is ideal for websites, blogs, email newsletters and editing, because text reflows on any screen. Positioned layout places every line at its exact spot, which keeps forms, brochures and multi-column designs recognisable. Exact look adds a picture of each page behind an invisible text layer, so it looks identical to the PDF while text stays selectable and searchable.

Does the HTML keep fonts and colors?

Text flow uses clean web styling instead of the PDF fonts. Positioned layout keeps font sizes, bold and italic, and maps fonts to the closest web-safe family (sans-serif, serif or monospace), with each line stretched to its original width; text is shown in black. For the exact original fonts, colors and images, use Exact look.

Are images from the PDF included?

In Exact look, yes: each page is embedded as a JPEG image inside the HTML file, so it needs no extra files. Text flow and Positioned layout contain text only, which keeps them small and clean.

Why is the HTML output empty?

The PDF most likely contains scanned images with no text layer. Use Exact look to get the pages as pictures in HTML, or run the document through OCR first to make the text available.

Is the generated HTML safe to put on my website?

Yes. The output is static HTML and CSS with no JavaScript. All text from the PDF is escaped, and only http, https and mailto links are kept.

Is my PDF uploaded?

No. The PDF is read with pdf.js inside your browser and the HTML is generated on your device. Nothing is sent to a server.

Related tools

PDF to MarkdownConvert PDF to clean Markdown with headings, lists, tables, bold, italics and links.PDF to Text ConverterExtract the text from any PDF page by page, then copy it or save it as a TXT file.HTML to PDF ConverterPaste HTML and CSS, preview it as pages and download a PDF, safely in your browser.HTML FormatterBeautify and indent HTML code with a live preview.Merge PDFCombine several PDF files into one document.Compress PDFReduce PDF file size while keeping it readable.JPG to PDFCombine JPG photos into one PDF with page size, margins and orientation options.PDF to WordConvert PDF files to editable Word documents.PDF to ExcelExtract tables from PDF files into an Excel spreadsheet (XLSX) or CSV, right in your browser.PDF to JPGTurn PDF pages into high-quality JPG images.PDF to PNGConvert PDF pages to PNG images with custom DPI and transparent background.Word to PDFConvert Word DOCX documents to PDF.Image to PDFConvert JPG, PNG, WEBP and more into a PDF.Split PDFExtract pages or split a PDF into separate files.Delete PDF PagesRemove pages from a PDF using a visual thumbnail grid.Rotate PDFRotate one page or all pages of a PDF by 90, 180 or 270 degrees.Add Page Numbers to PDFNumber PDF pages with your choice of position, format and font.Watermark PDFStamp a text or logo watermark on PDF pages with custom opacity.Invoice GeneratorCreate professional invoices and save them as PDF.Sign PDFDraw, type or upload a signature and place it on any PDF page, free and private.Fill PDF FormFill in PDF form fields online: text boxes, checkboxes, radio buttons and dropdowns.PDF Metadata EditorView and edit a PDF's title, author, subject, keywords and dates, or clear them all.Text to PDF ConverterTurn plain text or a .txt file into a clean PDF with your font, size, margins and page size.Markdown to PDF ConverterWrite or paste Markdown, preview it with a clean theme and export a polished PDF in seconds.Excel to PDF ConverterConvert Excel and CSV sheets into tidy, paginated PDF tables with repeated headers.Flatten PDFFlatten PDF form fields and annotations into the page so they can no longer be edited.Grayscale PDFConvert a color PDF to grayscale or pure black and white for printing, right in your browser.PDF ViewerOpen and read PDF files in your browser with zoom, search, thumbnails and fullscreen.PDF Word CounterCount words, characters and lines in a PDF, page by page, with top words and CSV export.Organize PDFReorder, rotate, delete and duplicate PDF pages with drag-and-drop thumbnails.Crop PDFTrim PDF margins by dragging a crop box on the page, for all pages or selected ones.Resize PDFChange PDF page size to A4, Letter, Legal, A3 or custom and scale content to fit.Extract Images from PDFPull every embedded photo and graphic out of a PDF as PNG or JPG, or save pages as images.Redact PDFBlack out names, numbers and any text in a PDF for real: the hidden text is removed, not covered.PDF EditorAdd text, whiteout, shapes, images and drawings to any PDF page, then save a new PDF.Resume BuilderFill in a simple form, pick one of 3 clean templates and download your resume as a PDF.PDF to PowerPointTurn every PDF page into a PowerPoint slide (PPTX) in 16:9, 4:3 or the PDF's own size.Compare PDFCompare two PDF files and see added, removed and changed text side by side, page by page.Insert Pages into PDFInsert blank pages or pages from another PDF anywhere in your document, privately in your browser.PDF Page CounterCount the pages of many PDFs at once, with totals, page sizes and a CSV export.Add Header and Footer to PDFAdd header and footer text with page numbers, date and file name to every PDF page.Invert PDF ColorsTurn a PDF into dark mode: invert colors, keep hues or use a night sepia theme for easy reading.PDF N-UpPrint 2, 4, 6, 9 or 16 PDF pages per sheet with your own order, margins and borders.PDF Booklet MakerTurn a PDF into a print-ready folded booklet: pages imposed 2 per sheet in saddle-stitch order.PDF to Long ImageStitch all PDF pages into one tall PNG or JPG image, with gap, width and page range options.PNG to PDFConvert PNG images to one PDF, keeping transparency or filling it with white or any color.HEIC to PDFConvert iPhone HEIC photos into one PDF in your browser, with page size, margins and reordering.CSV to PDFTurn a CSV file into a clean, paginated PDF table with repeating headers.Add Stamp to PDFStamp APPROVED, PAID, DRAFT or custom text with a date onto any PDF page.Remove Blank Pages from PDFFind and delete empty or near-blank pages in a PDF automatically.