How to use it
- Choose or drop a PDF file.
- Choose Paragraphs and headings or Positioned layout.
- Select Convert to HTML and wait for all pages to be read.
- Check the preview, then copy the code or download the .html file.
How it works
The tool reads the text layer of each page with pdf.js: every piece of text with its position and font size. In Paragraphs and headings mode, pieces on the same baseline are joined into lines, and lines are grouped into paragraphs by their vertical spacing and indentation. Lines in clearly larger type than the body text become headings (h1–h3), lines starting with a bullet or a number such as 1. become list items, and words hyphenated at a line end are joined when the next line starts with a lowercase letter. An HTML comment marks where each page begins.
In Positioned layout mode every piece of text becomes a span placed at its coordinates on a box the size of the page, using a generic serif, sans-serif or monospace font. It resembles the PDF but is not suited for editing.
Only text is converted. Images, drawings, table borders, colours, fonts, bold and italic, and links are not carried over; tables come out as lines of text. Multi-column pages are read in the order the text is stored, which is usually but not always the reading order. Scanned PDFs have no text layer and need OCR first. All text is HTML-escaped.
Examples
Putting a brochure online
A two-page product brochure becomes h2 headings, paragraphs and bullet lists that paste into a CMS and adapt to phone screens.
Checking the text layer
The positioned layout shows exactly where each text fragment of a form sits on the page, useful for debugging PDF generation.
Frequently asked questions
Are images and tables converted?
No. Only the text layer is read. Images and graphics are skipped, and table cells come out as text lines because a PDF does not record which text belongs to which cell.
Why is a heading detected as a paragraph (or the other way round)?
Headings are recognised only by being larger than the most common text size. Bold text of normal size stays a paragraph, and large decorative text may become a heading.
Why is the order of paragraphs wrong?
The tool follows the order in which text is stored in the PDF. Some programs store columns, sidebars or captions in a different order from how they appear.
My PDF gives no text. What can I do?
It is most likely a scanned document. Recognise the text with OCR first, for example with Image to Text (OCR) on page images.
Privacy
The PDF is read in your browser with pdf.js. The file and the HTML are not uploaded, stored or included in analytics; only an anonymous event that the tool was used is counted.