PDF to PAGE XML converts a PDF into a PAGE XML document — the page analysis and ground-truth format used by OCR-D, OCR4all, Transkribus and the ICDAR Page Segmentation competitions . Drop a PDF onto the upload card and the tool reads every page with pdf.js, extracts the text layer, groups words into lines and lines into text regions, computes a polygon for each element, estimates baselines, and writes a valid PAGE XML file with the correct PcGts namespace. Fill in metadata (source, institution, OCR software), choose segmentation options, and press Generate PAGE XML. Everything runs in your browser — no uploads, no account.
What does the PDF to PAGE XML tool do?
The PDF to PAGE XML tool converts a PDF into a PAGE XML document. It reads every page with pdf.js, extracts the text layer, groups words into lines and lines into text regions (blocks), computes a polygon for each element (x,y points), estimates baselines, and writes a valid PAGE XML file. The output is the standard page analysis format used by OCR-D, OCR4all, Transkribus, the ICDAR Page Segmentation competitions and most historical document projects.
People search for "PDF to PAGE XML" or "PAGE format converter" when they work with OCR-D and need to convert PDFs into the PAGE format its processors expect, when they are building a training dataset for page segmentation and need polygon ground truth, when they want to import a PDF into OCR4all for OCR correction, or when they need to export page analysis results for a digital humanities project. This tool produces exactly that output in a few seconds, entirely in the browser.
Under the hood, the tool uses pdf.js to read the PDF text layer — the same engine Firefox uses to display PDFs, so it handles every common PDF correctly, including OCR'd scans.
Important: PAGE XML is a container for OCR and layout analysis results, so the tool needs a text layer to read. A scanned PDF that is pure images has no text layer — run OCR first (with Tesseract, Calamari or any OCR-D processor) to add word-level coordinates, then convert to PAGE XML. pdf.js preserves the word boxes from the OCR engine, so the PAGE output matches what the OCR produced.
How do I convert a PDF to PAGE XML?
- Add your PDFDrag a PDF onto the upload card, browse your device, or import from Google Drive or Dropbox. The document is read in your browser with pdf.js — nothing is uploaded.
- Fill in PAGE metadataEnter the source description, the institution holding the original, and the OCR software used. These populate the PAGE <Metadata> block for OCR-D and OCR4all compatibility.
- Choose segmentation optionsToggle text regions (blocks), baseline detection, reading order, and word-level segmentation. The live preview shows the first page’s PAGE XML as it will be written.
- Generate and downloadPress Generate PAGE XML. Every page becomes a <Page> element with <TextRegion> blocks containing <TextLine> and <Word> elements — each with a polygon (points) and optional baseline — ready for OCR-D, OCR4all, Transkribus import or a digital library ingest pipeline.
What can the tool do?
| Feature | What it does | Default |
|---|---|---|
| PAGE XML output | Valid PAGE XML 2019-07-15 with correct PcGts namespace. | Always on |
| TextRegion | Groups lines into text regions (blocks). | On |
| TextLine | Groups words into lines by Y position. | Always on |
| Word | Emits individual words with polygon coordinates. | On |
| Polygon coordinates | Each element gets a tight polygon from the text items. | Always on |
| Baseline | Estimates the baseline slope of each line. | On |
| Reading order | Adds reading order indices to regions and lines. | On |
| Metadata | Source, institution, OCR software in the metadata block. | Always on |
What is PAGE XML?
PAGE (Page Analysis and Ground-truth Elements) is an XML framework originally developed by Stefan Pletschacher and Apostolos Antonacopoulos at the University of Salford . It records the layout structure of a document page — text regions, text lines, words, with polygon coordinates and baselines — alongside image characteristics and OCR content. It is maintained by the OCR-D project and is the standard format for page segmentation ground truth and OCR workflows in digital humanities and historical document analysis.
- OCR-D: the German national OCR framework for historical print uses PAGE as its intermediate format between processors [citation:7].
- OCR4all: the open-source OCR workflow for historical documents uses PAGE XML for its segmentation and OCR interfaces [citation:7].
- Transkribus: supports PAGE import/export for handwritten text recognition projects.
- ICDAR competitions: the Page Segmentation competitions use PAGE for ground truth and evaluation .
- Polygon flexibility: unlike ALTO’s rectangular bounding boxes, PAGE polygons can be rotated or irregular — essential for skewed historical text.
What does the PAGE XML output look like?
A minimal PAGE XML file from this tool has the following hierarchy:
<PcGts>— root element with the PAGE namespace and schema location.<Metadata>— creator, created timestamp, and your source/institution/software fields.<Page>— one per PDF page, withimageWidthandimageHeight.<TextRegion>— one per detected block, with atypeattribute and a<Coords>polygon.<TextLine>— one per line, with a<Coords>polygon and an optional<Baseline>.<Word>— one per word, with a<Coords>polygon and text content.<ReadingOrder>— optional block and line ordering indices.
All coordinates are integers in PDF points (1 pt = 1/72 inch), which is the default PAGE unit when no explicit measurement unit is set.
When do you need PDF to PAGE XML?
OCR-D pipeline
Convert PDFs into PAGE XML so OCR-D processors can consume them.
OCR4all
Import a PDF's page layout into OCR4all for manual correction and OCR.
Segmentation training
Generate polygon ground truth for training layout analysis models.
Handwriting projects
Import into Transkribus for HTR workflows that accept PAGE.
Digital libraries
Store layout analysis results in the standard format used by archives.
Research datasets
Produce structured PAGE files for computational document analysis.
Does the tool upload my PDF to a server?
No. The document is read and converted entirely in your browser with pdf.js. Nothing is uploaded, nothing is sent anywhere, and nothing remains after you close the tab. That makes it safe for manuscripts, rare books, restricted archives and any digitized material subject to license or access agreements.
- Local read. Every page is read in memory in your browser tab.
- Local encode. The PAGE XML is built in JavaScript and handed back as a download.
- No account needed. You can convert PDFs without logging in. Read our privacy policy for details about the site.
Tips for clean PAGE XML output
- Run OCR first for scans. PAGE XML is a container for OCR and layout analysis — if the PDF has no text layer, the PAGE file will be empty.
- Fill in metadata. The
<Metadata>block is required by OCR-D and OCR4all; blank fields make the file non-compliant. - Adjust the block gap tolerance. Documents with wide paragraph spacing need a larger gap tolerance to group lines into the correct text regions.
- Use baselines for OCR correction. OCR engines use baselines to separate ascenders from descenders before recognition.
- Validate against the PAGE schema. Download the PAGE 2019-07-15 XSD from the OCR-D repository and validate the output before ingest.
- Pair with METS/MODS. Most repositories expect a METS wrapper that references the page image and the PAGE file for each page.
Common problems and quick fixes
| Problem | Likely cause | Fix |
|---|---|---|
Empty <Page> element | Scanned PDF with no text layer | Run OCR first, then convert |
| One giant TextRegion per page | Lines are very close together | Increase the block gap tolerance, or turn off region detection to get one region |
| Polygon coordinates are wrong | Page has a /Rotate value | Rotate the PDF with the Rotate PDF tool first |
| Baseline slope is off | Text is rotated or skewed | Deskew the PDF before converting |
| Special characters broken | Non-Unicode encoding in the source | Re-OCR with a Unicode-aware engine |
| File fails PAGE validation | Project uses a custom PAGE extension | Validate against the base PAGE 2019-07-15 schema first |
Related tools
Frequently asked questions
What does the PDF to PAGE XML tool do?
What is PAGE XML?
Is the tool free?
Does it upload my PDF to a server?
Does the PDF need to be OCR’d first?
Which PAGE XML version is generated?
What is a polygon in PAGE XML?
What is a baseline?
How does the tool detect text regions?
What are the use cases for PAGE XML?
Does it work on mobile?
Ready to convert your PDF to PAGE XML?
Extract text regions, lines, words and polygons as PAGE XML — free, private, no signup.
Generate PAGE XML now