pdftoolskit.org
65 PDF tools that run in your browser
Sign in Create account

PDF to HTML: Convert PDF to a Web Page

semantic flow or positioned layout · standalone or fragment

Turn a PDF into HTML in your browser, with nothing uploaded. Flowing mode gives you headings and one paragraph per line of text, for a page people will read. Positioned mode places every text run at its PDF coordinates, for when position matters more than reading order.

Drop PDF files here or click to select

One or many · an .html per file

    no files
    Ready.

    No PDF handy? Try sample-10-pages.pdf. More free sample files.

    The two modes

    Flowing wraps each PDF page in <section class="page" id="page-N">. Inside, every line of text becomes its own <p>. A line at least 45% larger than the document's median line size becomes <h2>; at least 18% larger becomes <h3>. Lines that the PDF wrapped are not rejoined, so a long paragraph arrives as a run of short paragraphs. If you need real paragraphs, convert with PDF to Word, which rejoins them.

    Positioned emits a <div class="page"> per page with the page's width and height, and one absolutely positioned <span> per text run with left, top and font-size. The values are PDF points written as CSS pixels, so the page renders at three quarters of its printed size. Font family, weight and colour are not carried, and nothing reflows. It is useful for checking where text sits, not for publishing.

    Standalone or fragment

    A standalone file has a doctype, lang="en", a UTF-8 charset, the PDF's filename as <title> and a short inline stylesheet: 16 px system font, 44 rem column, h2 at 1.4 rem and h3 at 1.15 rem. Change the lang attribute if the document is not in English. A fragment is only the sections, for pasting into a CMS or template that has its own styles. In both, text is escaped, so angle brackets in the PDF show as text.

    What is not converted

    How to convert a PDF to HTML

    1. Drop the PDF or PDFs. Each becomes its own .html file, named like the PDF.
    2. Choose the layout: flowing for headings and paragraphs you can restyle, positioned for text pinned at its original coordinates.
    3. Choose standalone or fragment: a complete file to open in a browser, or bare sections to paste into a template.
    4. Click Convert to HTML and use the Download link that appears for each file.
    5. Open the file in a browser and check the reading order, especially on multi-column pages, where lines from both columns interleave.

    FAQ

    Which mode should I choose?

    Flowing, unless you need the coordinates. Flowing output is readable on a phone, works with screen readers and is easy to restyle. Positioned output is a snapshot that breaks as soon as the font changes.

    Are the headings real headings?

    Yes, <h2> and <h3>, chosen by font size relative to the document's median line. There is no <h1>. Decorative large text also qualifies, so check them before publishing.

    Why is every line its own paragraph?

    Flowing mode does not rejoin wrapped lines; it emits one <p> per line the PDF drew. PDF to Word rejoins lines into paragraphs if that matters.

    Can I get the images too?

    Not from this tool. Extract images pulls the embedded raster images out; reference them from the HTML by hand.

    What about scanned or password-protected PDFs?

    A scan has no text layer, so the batch stops with "No text layer" at that file. Run OCR PDF first, or embed page images from PDF to images instead. A password-protected file will not open; use Unlock PDF first.

    Related tools

    Part of: Pull a table out of a PDF into a spreadsheet

    Excel and CSV use the same column detection; try Excel first because it keeps pages as sheets. Positioned HTML is the fallback when columns will not separate.

    1. 1 PDF OCR Only if the statement is a scan with no text layer
    2. 2 PDF to Excel Converter Every page as a sheet in one .xlsx
    3. 3 PDF to CSV Converter The same rows as plain CSV for a script or a database
    4. 4 PDF to HTML Converter Absolutely positioned spans when the column gaps are too irregular

    This workflow, start to finish · all 20 workflows