1. Home
  2. PDF
  3. PDF to HTML

PDF to HTML

Extract a PDF's text and tables as structured HTML. Layout is not kept.

Runs in your browser · No upload
This rebuilds headings, paragraphs, lists and tables as HTML by guessing from text positions. Fonts, colours, pictures and the exact layout are not carried over, and pictures are not included. Always check the result by eye.

How to use

  1. Drop a PDF on the page. For a password-protected PDF, enter the password to open it.
  2. Choose the page range and options (remove headers and page numbers, page separator, whole document or fragment).
  3. Press Convert to HTML. The beginning of the result appears; use Download HTML to save the file or Copy to take the source.

What is carried over, and how

A PDF has no “heading” or “paragraph” structure, only the position and size of characters. This tool looks at those positions and guesses the structure, then rebuilds it with HTML tags.

What it sees in the PDF In the HTML
Text 1.15 times larger than the body, or a single bold line h1 to h3 headings (1.6 times or more is h1, 1.3 times or more is h2)
Lines close together at normal spacing p paragraphs (an English hyphen at a line end is joined)
Bold and italic text strong, em
Lines starting with a bullet, a dash, 1., a circled number or a Korean letter marker ul or ol lists (indented items are nested)
Three or more lines sharing the same column positions table (the first row can be a th header)
A page set in two columns The left column first, then the right

All text is escaped when inserted, so characters like < or & in the PDF can never turn into tags.

Options

Option What it does
Remove headers, footers and page numbers Within the top and bottom 10% of a page, drops lines that repeat on at least 3 pages (and at least half of them) and lines that are only a page number (3, 3 / 10, Page 3).
Join paragraphs across a page break If the last paragraph of a page runs close to full width and the sentence is unfinished, it is joined to the first paragraph of the next page.
Page separator None, a rule (hr), or a section per page (with id and data-page attributes so you can jump to a page).
Whole document / fragment Whole adds DOCTYPE, lang, title and basic styling; fragment makes only the body content to paste inside body.

Limits

  • The original look is not kept. Fonts, colours, backgrounds, exact positions, footnote placement and text boxes are lost.
  • Pictures and shapes are not included. This is a text-and-table conversion.
  • Tables without ruling lines, merged cells and right-aligned number columns may not be recognised, or their cells may shift.
  • Heading levels come from text size, so a heading the same size as the body becomes a paragraph.
  • Scanned or photographed PDFs have no text layer and cannot be converted. Run PDF OCR first.
  • Up to 300 pages are converted at once. A PDF whose author restricted copying is converted only after you confirm.

Frequently asked questions

How do I convert a PDF to HTML?

Drop the PDF on this page and press Convert to HTML. You get a complete HTML document ready to publish; choose the fragment option if you need only the body.

Why does the HTML look different from the PDF?

A PDF draws characters at fixed positions, while HTML flows to the screen width, so a one-to-one copy is not possible. This tool guesses the structure of the text and builds flowing HTML from it.

My table did not come out as a table.

Tables aligned with spaces instead of lines, or with only two columns, are sometimes not recognised. The “every line as a table” feature of PDF to Excel can help then.

Page numbers and headers are mixed into the text.

Check that the header and footer removal option is on. It looks for repeating lines across 3 or more pages, so for a two-page PDF only the page numbers are removed.

Is my file uploaded?

No. The PDF is read and converted in your browser and never sent to a server.

For plain text use PDF to text, for an editable document PDF to Word, and for Markdown PDF to Markdown. To tidy the HTML use HTML beautify and minify, and to go back to Markdown use HTML to Markdown. Your file is processed only in your browser and never sent to a server.

Can't find the tool you need?

Tell us what you want to do. We build the most requested tools first.