PDF to ALTO XML converts a PDF into an ALTO v4.4 XML document — the digital library standard used by Europeana, DPLA, HathiTrust, the Library of Congress and most national archives. Drop a PDF onto the upload card and the tool reads every page with pdf.js, extracts the text layer's word positions, groups words into lines and blocks, and writes a valid ALTO file with <Page>, <TextBlock>, <TextLine> and <String> elements — each word with its exact HPOS, VPOS, WIDTH and HEIGHT coordinates. Fill in metadata (source, institution, OCR software), choose the measurement unit, and press Generate ALTO XML. Everything runs in your browser — no uploads, no account.
What does the PDF to ALTO XML tool do?
The PDF to ALTO XML tool converts a PDF into an ALTO XML v4.4 document. It reads every page of the PDF, extracts every word with its exact bounding box (HPOS, VPOS, WIDTH, HEIGHT), groups words into lines and blocks, and writes a valid ALTO XML file. The result is a layout-preserved XML that digital libraries, archives and repositories like Europeana, DPLA, the Library of Congress and BnF use to store OCR alongside page images.
People search for "PDF to ALTO" or "ALTO XML converter" when they are building a digital library ingest pipeline, when a repository requires ALTO rather than plain OCR text, when they need to align OCR text with page images in a viewer, or when an archival project requires the standard Europeana / LOC format for scanned materials. 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: ALTO is a container for OCR output, so the tool needs a text layer to read. A scanned PDF that is pure images has no text layer — run OCR first (with the OCR PDF tool or Tesseract) to add word-level coordinates, then convert to ALTO. pdf.js preserves the word boxes from the OCR engine, so the ALTO output matches what the OCR produced.
How do I convert a PDF to ALTO 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 ALTO metadataEnter the source description (e.g. book title), the institution holding the original, and the OCR software you used. These populate the ALTO <Description> section so the file is Europeana and LOC compliant.
- Set page dimensionsChoose whether to use real page size (from the PDF’s MediaBox) or a fixed standard like A4 or Letter. ALTO requires the page dimensions in the <Page> element — the tool reads them automatically from each PDF page.
- Generate and downloadPress Generate ALTO XML. Every word, line and block from the PDF text layer is exported with precise X/Y/Width/Height coordinates in ALTO v4.4 format, ready to import into a digital library platform or archival repository.
What can the tool do?
| Feature | What it does | Default |
|---|---|---|
| ALTO v4.4 output | Full ALTO XML with correct schemaLocation and namespace. | Always on |
| Word coordinates | HPOS, VPOS, WIDTH, HEIGHT per word from the PDF text layer. | Always on |
| Blocks | Groups lines into <TextBlock> using position heuristics. | On |
| Lines | Groups words into <TextLine> by Y position. | Always on |
| Page dimensions | Uses the PDF’s MediaBox for the <Page> element. | Always on |
| Description metadata | Source, institution, software, date in the ALTO header. | Always on |
| Measurement unit | Pixel, mm10 or inch1200. | Pixel |
| Bold detection | Adds @STYLE from font names containing "Bold". | On |
| Hyphenation join | Joins "exam-" + "ple" into "example" using adjacent-line spans. | Off |
| Word spacing | Inserts <SP> elements between words. | On |
What is ALTO?
ALTO (Analyzed Layout and Text Object) is an XML schema developed by the METAe project and maintained by the Library of Congress. It is the de-facto standard for storing OCR output with layout information — the exact position of every word, line, block and page. Digital libraries use ALTO to link OCR text to page images so viewers can highlight the OCR text over the scan.
- Adopted widely: Europeana, DPLA, HathiTrust, the Library of Congress, BnF, the British Library and most national digitization programs use ALTO.
- Layout-preserved: Unlike plain-text OCR, ALTO carries the exact X/Y coordinates of every word — essential for highlighting search hits on the page image.
- Versioned: Currently at v4.4 with a formal schema (Relax NG + XSD) and maintained by the Library of Congress.
- Complementary: Often used alongside METS (structural metadata) and MODS (descriptive metadata) — METS points to page images, MODS describes the volume, ALTO describes what is on each page.
What does the ALTO output look like?
A minimal ALTO file from this tool has the following hierarchy:
<alto>— root element with namespace and schemaLocation for ALTO v4.4.<Description>— measurement unit, source image info, OCR processing software, date, and (optional) institution.<Styles>— font style definitions used by the strings.<Layout>— one<Page>per PDF page, with page dimensions (WIDTH, HEIGHT in the chosen unit), and a<PrintSpace>containing<TextBlock>s.<TextBlock>— one per detected block, containing<TextLine>s.<TextLine>— one per line, containing<String>s and optional<SP>s.<String>— one per word, with CONTENT (the text), HPOS, VPOS, WIDTH, HEIGHT, and optional STYLE attribute.
All coordinate values are integers in the chosen measurement unit (pixel by default, mm10 or inch1200 for archival standards that require metric measurements).
When do you need PDF to ALTO XML?
Digital libraries
Ingest scanned books and manuscripts into Europeana, DPLA or a local repository.
Newspaper archives
Convert scanned newspapers so users can search and highlight OCR over the page image.
Manuscript projects
Add word-level OCR to handwritten transcriptions for scholarly comparison.
Rare book digitization
Preserve layout in legal deposit and heritage collection workflows.
Search highlighting
Draw a highlight box over the exact word position when a search hit is found.
Corpus linguistics
Extract word-level coordinates for OCR analysis, layout classification or reading-order research.
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 restricted archives, rare books, manuscripts 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 ALTO 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 ALTO output
- Run OCR first for scans. ALTO is a container for OCR output — if the PDF has no text layer, the ALTO file will be empty.
- Choose the right measurement unit. European repositories often require
mm10(0.1 mm units) for ALTO. LOC and DPLA typically accept pixel. - Fill in source and institution. The ALTO
<Description>block is required for ingest into most repositories; blank fields make the file non-compliant. - Turn on hyphenation join for books. Printed books hyphenate words across line breaks; joining them improves search and reading.
- Validate against the ALTO schema. Download the ALTO v4.4 schema from the Library of Congress site and validate the output with xmllint or Oxygen before ingest.
- Pair with METS. Most repositories expect a METS wrapper that references both the page image and the ALTO file for each page. Build that in your pipeline.
Common problems and quick fixes
| Problem | Likely cause | Fix |
|---|---|---|
Empty <Layout> element | Scanned PDF with no text layer | Run OCR first, then convert |
| Word boxes misaligned with the image | Page has a /Rotate value or a non-zero MediaBox origin | Use the tool’s default (auto-reads MediaBox); if misaligned, rotate the PDF with the Rotate PDF tool first |
| One giant block per page | Lines are very close together | Turn on Detect text blocks — the algorithm splits on larger vertical gaps |
| Hyphenation not joined | Hyphenation join is off | Enable Enable hyphenation join |
| Coordinates are 0 or negative | Unusual MediaBox origin | Normalize the PDF with the Resize PDF tool first |
| Special characters broken | Non-Unicode encoding in the source | Re-OCR with a Unicode-aware engine |
Related tools
Frequently asked questions
What does the PDF to ALTO XML tool do?
What is ALTO XML?
Is the tool free?
Does it upload my PDF to a server?
Does the PDF need to be OCR’d first?
Which ALTO version is generated?
What are HPOS, VPOS, WIDTH and HEIGHT?
Are blocks, lines and words grouped correctly?
Does it preserve reading order?
What are the ALTO Description fields?
What are the use cases for ALTO XML?
Does it work on mobile?
Ready to convert your PDF to ALTO XML?
Extract word coordinates, lines and blocks as ALTO v4.4 — free, private, no signup.
Generate ALTO XML now