Skip to content
BabaPDF
Learn

What a tagged PDF is, and which tools keep the tags

6 min readArticle

A tagged PDF carries a hidden tree of labels (heading, paragraph, table, figure) that tells screen readers what each part of a page is and what order to read it in. It looks identical to an untagged PDF; only software that reads the structure can tell.

A tagged PDF carries a hidden tree of labels that says what each part of a page is (this is a heading, this is a paragraph, this is a table) and the order to read them in. On screen it looks exactly like an untagged PDF. The difference matters to software that has to understand the page, such as a screen reader.

What does it mean if a PDF is tagged?

It means the file has a structure tree. Each entry in the tree is a tag, such as H1, P or Figure, and each tag points at the exact text or picture on the page that it describes. The file also carries a flag saying it is tagged, and usually a language.

A PDF page on its own is only drawing instructions: these letters, at this spot, at this size. Nothing in them says "heading". To software, large bold text is just large bold text. What a PDF page actually is explains that model.

What is the difference between a PDF and a tagged PDF?

To the eye, none. The difference is for software that reads instead of looks. Without tags, a screen reader has to guess the reading order from where text sits, so two columns can be read straight across as one, and a chart has nothing to say about itself. With tags, the reader follows the tree.

  • Headings and their levels, so a screen reader user can jump from section to section.
  • Reading order, which can differ from the order the text was drawn in.
  • Alternative text on a Figure tag, the only way a picture gets described aloud.
  • Table structure, so each cell is read with its column header.
  • The document language, so the voice pronounces the words correctly.
A dark flat slab with a cluster of bright round nodes on thin dark branches rising beside it, the lowest node resting on the slab's edge
The page you see, and the tree of labels behind it that a screen reader follows.

What are tags in a document?

Tags are labels with names borrowed from HTML: H1 to H6 for headings, P for paragraphs, L and LI for lists, Table, TR, TH and TD for tables, Figure for pictures and Link for links. Each one points into the page through a small number stamped around the text it covers.

Anything that is decoration, such as a running header or a page number, should be marked as an artifact instead, so a reader skips it. PDF/UA, the ISO standard for accessible PDF, requires every piece of content on a page to be one or the other: tagged, or marked as an artifact.

Does a PDF made on this site come out tagged?

No, and I checked the output rather than assuming. I ran Word to PDF, Excel to PDF, CSV to PDF and TXT to PDF through their real code and read each result with pdf.js, a different library from the ones that wrote them. None had a structure tree or the tagged flag.

So a Heading 1 in your .docx comes out as larger, bold text that looks like a heading and is not marked as one. The image-based converters (JPG, PNG and Scan to PDF, and HTML to PDF, which captures the page as a picture) have no tagging code at all. The reverse direction ignores tags too: PDF to Word never reads the tree, even when a file has one. It guesses headings from text size.

There is a tempting shortcut that does not work. The library behind Word, Excel and CSV to PDF has a tagged setting, off by default. I switched it on in a test file. pdf.js then reported the PDF as tagged, with a structure tree that held its root and nothing else: no headings, no paragraphs. A file that says it is tagged while labelling nothing would mislead anyone who checks only the flag, so the setting stays off.

If the PDF has to pass an accessibility check, export it from Word itself. Microsoft's guide to creating accessible PDFs says to keep "Document structure tags for accessibility" ticked in the PDF options when you save. I have not tested that here. Our Word to PDF suits a file you need to print or send; how to convert Word to PDF covers what it keeps.

Word to PDFConvert a Word .docx into a PDF with real, selectable text.

Which tools keep the tags in a PDF you already have?

I made a tagged two-page test file with pdfkit, a library this site does not edit with: a heading, two paragraphs, the language en-US and the PDF/UA marker. Then I ran it through each tool's real code and read every result with pdf.js.

  • Kept everything (tree, tagged flag, language): Rotate PDF, Crop PDF, Compress PDF, Add Watermark, Add Page Numbers, PDF to PDF/A, Flatten PDF in Form fields only mode, and Protect PDF, read back with its password. Protect also allows extraction for accessibility tools, as what a PDF password actually protects explains.
  • Kept the tree but lost the PDF/UA marker: Edit Metadata. It deletes the file's XMP metadata block, and that block is where the marker lives.
  • Lost the tree, the tagged flag and the language: Merge PDF, Extract Pages, Delete Pages and Organize Pages. They copy pages into a new file. Split PDF and Redact PDF build their output the same way in the code, so they drop tags too.
  • Flatten PDF to images turns each page into a picture, so there is nothing left to tag.

Add Watermark and Add Page Numbers keep the tree, but the stamp they add is neither tagged nor marked as an artifact. My test output had no artifact markers at all. Under the PDF/UA rule above, a file that passed before stamping no longer meets it. If it must stay compliant, stamp the source document and export again.

A dark slab with a bright leafy tree standing on it, and an arrow pointing to a matching slab where a small bright tree lies tipped over at the far corner
Tools that copy pages into a new file leave the tag tree behind.

How do I remove tags from a PDF document?

Run it through a tool that copies the pages into a new file. Extract Pages with every page selected does it. In my test, the output had no structure tree, no tagged flag and no language. The copy also drops bookmarks, form fields and the title, so check you can live without those.

The tags are disconnected, not scrubbed. The small numbers that tied text to its tags stay in the page content, pointing at a tree that is gone. Viewers ignore them. If the real problem is a wrong tree, removing it only sends a screen reader back to guessing. Re-tagging at the source is the fix.

Extract PagesPull selected pages out into a brand-new PDF.

How to fix PDF accessibility issues?

Fix them in the document the PDF came from, then export again with tags on. Nothing on this site adds or repairs tags. Give headings real heading styles, give pictures alt text, mark table header rows, and set the language. Then check the new PDF with an accessibility checker.

To see whether a file is tagged at all, the University of Washington's guide says Adobe Acrobat shows a Tagged PDF line, Yes or No, under File, Properties. That is untested here. Archival rules care too: PDF/A level A requires tags, and our PDF/A tool keeps the tags a file already has but cannot add any. What PDF/A actually requires covers the levels.

Keep reading