Imagine a centuries-old manuscript sitting in a library archive. Scholars want to study it, search it, compare it with other works, and preserve it for future generations. But a simple scanned image or plain typed copy strips away vital information: which words were corrections, where one page ended, who wrote a marginal note, or which character spoke a line in a play. The Text Encoding Initiative (TEI) solves exactly this problem. It is a set of guidelines that tells scholars how to mark up texts so that computers can read, search, and analyse them without losing the rich detail that makes a text meaningful. For students of library and information science, TEI sits at the heart of how the humanities have moved into the digital age.

Table of Contents

What is the Text Encoding Initiative?

The Text Encoding Initiative is a community-developed standard for representing texts in digital form. Its central output is a set of Guidelines that specify encoding methods for machine-readable texts, chiefly in the humanities, social sciences, and linguistics. In simpler terms, TEI is an agreed-upon way of “tagging” the parts of a text so that a computer understands what each part is, a heading, a stanza, a personal name, a date, a correction, and much more.

TEI is not a single piece of software you download. It is best understood as several things at once. It is a set of guidelines for encoding humanities texts, a standards organisation that maintains the encoding language, an international consortium that supports this work, and a worldwide community of projects and scholars who use these guidelines in practice. The TEI Consortium is a nonprofit membership organisation made up of universities, research projects, and individual scholars who collectively develop and refine the standard.

The project began in 1987, when scholars working with early digital texts realised they faced a kind of digital Tower of Babel. Each project invented its own way of marking up texts, which meant that material created by one team could rarely be reused by another. The TEI was established to develop hardware- and software-independent methods for encoding humanities data in electronic form, so that scholarly work could be shared, preserved, and reused across institutions and decades. Since the first full guidelines appeared in the mid-1990s, libraries, museums, publishers, and individual researchers have used TEI to present texts for online research, teaching, and long-term preservation.

Why machine-readable texts matter

A “machine-readable” text is one that a computer can interpret structurally, not just display as a flat string of characters. When a poem is encoded in TEI, the computer knows which lines belong to which stanza, which words are the title, and which note was added by an editor. This makes powerful operations possible: searching every speech by a single character across an entire play, generating an index of all the place names mentioned in a travel diary, or comparing different manuscript versions of the same work. Without structured encoding, the computer sees only undifferentiated text and none of this analysis is possible.

The TEI markup language: from SGML to XML

TEI works through markup, the practice of inserting tags into a text to describe its structure and meaning. Markup languages such as HTML are used to structure and describe data rather than to perform calculations like a programming language. TEI is a specialised markup vocabulary designed specifically to describe written texts.

When TEI was first developed in the late 1980s, it was built on SGML (Standard Generalized Markup Language), an international standard for marking up documents that had been published by the ISO in 1986. SGML was the natural foundation because it allowed encoders to maintain complex document structures. As technology evolved, the World Wide Web Consortium released a final recommendation for XML, the Extensible Markup Language, in February 1998. It quickly became clear that TEI needed to be re-expressed in this newer formalism to survive.

This shift unfolded across several versions of the Guidelines. TEI P3, released in 1994, became the de facto standard for humanities text encoding and was built on SGML. TEI P4 in 2002 was essentially P3 re-expressed in XML, while TEI P5, released in November 2007, was a thorough overhaul that introduced new modules for manuscript description, character encoding, graphics, and standoff annotation. P5 remains the current major version, with the Consortium publishing incremental updates roughly twice a year. Today, the TEI Guidelines collectively define a particular type of XML format, so TEI and XML are intrinsically related: TEI is essentially a detailed set of rules for writing XML to describe texts.

A flexible and customisable system

One of TEI’s defining strengths is its flexibility. The full Guidelines comprise many hundreds of elements and attributes covering an enormous range of textual features. No single project needs all of them. Instead, TEI is designed to be customised: a user adapts the standard to the specific type of document they are working with, whether that is medieval poetry, modern correspondence, or a linguistic corpus. This customisability is a core principle of the TEI’s architecture and is what allows the same underlying standard to serve such diverse scholarly needs.

As an encoding language, TEI can describe both the physical characteristics of a text, such as line breaks, pagination, and special characters, and its intellectual content, such as classifying subjects, tagging people, places, and events, adding linguistic markup, and recording editorial commentary. This dual capability is what makes it so valuable for serious scholarship.

Structure of TEI documents

Understanding how a TEI document is organised is essential. Like every XML document, a TEI file has a single root element that contains everything else in a strict hierarchy, with no overlapping tags. In TEI, that root is the <TEI> element. Within it, every TEI document has at least two parts: a header, represented by the <teiHeader> element, which contains metadata describing the document, and the text itself, usually represented by the <text> element.

The basic skeleton looks like this:

The teiHeader: metadata that travels with the text

The header is what distinguishes TEI from ordinary XML markup. It is a structured description of the document that answers questions like who wrote the text, when, where it was published, what the source material was, and under what licence it is shared. The <teiHeader> is the first mandatory element of a TEI document and always appears immediately after the opening <TEI> tag, ensuring that the metadata is considered an integral part of the electronic text rather than a detachable add-on.

The backbone of the header is the <fileDesc> (file description) element, which is required. According to the TEI guidelines, a file description minimally contains the title of the electronic text inside <titleStmt>, information about its publication inside <publicationStmt>, and bibliographic details about the source document inside <sourceDesc>. Together these record where the digital text came from and how it should be cited, which is the kind of bibliographic control that connects TEI directly to core library science. Notably, TEI header elements can be mapped to corresponding MARC fields, linking digital text encoding to established library cataloguing practice.

The text element and its hierarchy

Below the header sits the <text> element, which contains a single text of any kind, whether a poem, a play, a novel, a collection of essays, a dictionary, or a sample from a larger corpus. The <text> element is typically divided into a front (preliminary material like a title page or preface), a body (the main content), and a back (appendices, indexes, or notes).

Within the body, TEI handles structural subdivisions elegantly. Different cultures and document types name their divisions differently, one tradition’s “chapter within a book” may be another’s “section within a part”. Rather than imposing rigid names, TEI offers a single flexible element, <div>, for any structural subdivision, with attributes such as @type to specify whether a given division functions as a chapter, a volume, or something else. This approach reflects a model that scholars describe as an ordered hierarchy of content objects: the idea that a text can be decomposed into neatly nested parts, much like branches on a family tree. This model works remarkably well for a large proportion of documents, though TEI also provides techniques for the trickier cases where structures overlap, such as page breaks that cut across stanzas.

Applications of TEI in the humanities

The impact of TEI on digital scholarship has been significant. Historically it was used to create digital encodings of existing historical texts, but in recent years it has increasingly been used for born-digital content as well, including scholarly journals and online editions.

The most prominent application is the digital scholarly edition. Scholars use TEI to produce richly annotated versions of literary and historical works where every editorial decision is transparent and machine-actionable. A TEI edition can record variant readings across multiple manuscripts, expand abbreviations, mark uncertain passages, and link the text to images of the original source, all within a single structured file.

TEI is also widely used for encoding correspondence. The encoding of letters has a long tradition in the community, with early projects developing models for marking up features specific to letters, such as the sender, the addressee, closing phrases, and postscripts. This allows researchers to build searchable archives of historical correspondence and to study networks of communication at scale.

Why libraries and institutions rely on TEI

For libraries, museums, and archives, TEI serves three connected purposes: research, teaching, and preservation. Because the encoding is hardware- and software-independent and based on the open XML standard, a TEI document created today should remain readable for decades, long after specific software has become obsolete. This durability is precisely what cultural heritage institutions need. TEI files also support advanced retrieval: a digitised collection encoded in TEI can be searched by personal name, place, date, or genre, transforming a static archive into a dynamic research tool.

It is worth being realistic about the trade-offs. TEI encoding is detailed and labour-intensive, and because tag choices depend on human interpretation, two projects encoding the same text may make different decisions, which limits automatic interoperability. Even so, for serious humanities scholarship that demands precision, transparency, and longevity, TEI remains the leading standard, supported by a global community that continues to refine it.

What do you think? If you were tasked with digitising a rare regional manuscript collection in your library, would the long-term preservation benefits of TEI justify the considerable time and expertise its encoding demands? And as more humanities content is born digital rather than scanned from print, how might the role of a standard like TEI change in the coming decade?

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

References
  1. https://tei-c.org/
  2. https://tei-c.org/about/history/
  3. https://www.tei-c.org/release/doc/tei-p5-doc/en/html/AB.html
  4. https://www.contextractor.com/xml-tei/
  5. https://en.wikipedia.org/wiki/Text_Encoding_Initiative
  6. https://books.openedition.org/oep/681?lang=en
  7. https://guides.library.illinois.edu/xml/tei-header
  8. https://teibyexample.org/exist/tutorials/TBED02v00.htm
  9. https://www.tei-c.org/release/doc/tei-p5-doc/en/html/DS.html
  10. https://tei-c.org/release/doc/tei-p5-doc/en/html/SG.html

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Information Processing & Retrieval

1 Intellectual Organisation of Information

  1. Intellectual Organisation of Information
  2. Meaning of Intellectual Organisation of Information
  3. Why IOI is Necessary?
  4. IOI in Indexing Systems
  5. IOI and Indexing Languages
  6. IOI in User Services
  7. IOI and Content Analysis
  8. Information Retrieval Systems – Changing Environment
  9. Future Trends

2 Indexing Languages–Part I – Concepts and Types, Subject Headings Lists and Thesauri

  1. Indexing and its Types
  2. Indexing Language
  3. Vocabulary Control
  4. Classification Schemes
  5. Subject Headings Lists
  6. Thesaurus
  7. Thesaurofacet
  8. Classaurus
  9. Sears List of Subject Headings
  10. Library of Congress List of Subject Headings

3 Indexing Languages–Part II- Classification Schemes

  1. Dewey Decimal Classification (DDC) Scheme
  2. Universal Decimal Classification (UDC) Scheme
  3. Library of Congress Classification (LCC) Scheme
  4. Colon Classification (CC) Scheme
  5. Bibliographic Classification (BC) Scheme
  6. Library Bibliographical Classification (BBK) Scheme
  7. Broad System of Ordering (BSO) Scheme
  8. Special Classification Systems

4 Indexing Systems and Techniques

  1. Indexing Principles and Process
  2. Pre-Coordinate Indexing Systems
  3. Post-Coordinate Indexing Systems
  4. Automatic Indexing
  5. Non-Conventional Indexing: Citation Indexing
  6. Web Indexing

5 Evaluation of Indexing Systems

  1. Purpose of Evaluation
  2. Levels of Evaluation
  3. Evaluation Criteria
  4. Recall and Precision
  5. Other Performance Measures
  6. Relevance
  7. Evaluation Methodology
  8. Evaluation Experiments

6 Principles and Evolution of Bibliographic Description

  1. Bibliographic Description: An Overview
  2. Scope and Objectives of Bibliographic Description
  3. Evolution of Bibliographic Description
  4. Ranganathan’s Principles
  5. ISBDs
  6. Bibliographic Formats
  7. Electronic Resource Description
  8. Models of Bibliographic Description
  9. Bibliographic Description: Entities, Attributes and Relationships

7 Rules for Bibliographic Description

  1. Bibliographic Description: Its Origin
  2. Development of Anglo-American Code
  3. The International Standard Bibliographic Description (ISBD)
  4. Impact of ISBD on Catalogue Codes
  5. Bibliographic Description for Non-Print Materials
  6. Guidelines for Bibliographic Description of Electronic Resources
  7. Guidelines for Bibliographic Description of Internet Resources
  8. Rules for Description of Electronic Resources in AACR2 Revision 2002

8 Standards for Bibliographic Record Format

  1. International Standard Bibliographic Description (ISBD)
  2. MARC Format
  3. UNIMARC
  4. Common Communication Format (CCF)
  5. Indian Standard

9 Metadata- MARC21-856 Field, Dublin Core, TEI

  1. MARC21 – 856 Field
  2. Dublin Core Metadata Initiative (DCMI)
  3. Text Encoding Initiative (TEI)
  4. Procedure of Electronic Resource Description

10 Norms and Guidelines for Content Development

  1. Introduction
  2. Needs and Guidelines
  3. Standards Related to Electronic Content
  4. W3C Recommendations
  5. Electronic Text Encoding and Interchange
  6. Dynamic Content

11 Introduction to HTML and XML

  1. World Wide Web and Markup Languages
  2. Standard Generalized Markup Language (SGML)
  3. HyperText Markup Language (HTML)
  4. Basic HTML Tags
  5. Linking
  6. URLs
  7. HTML and the Browser
  8. eXtensible Markup Language (XML)
  9. XML Syntax and Semantic Tags
  10. Document Type Definition (DTD)
  11. Implications of XML in Library and Information Activities

12 Web-based Content Development

  1. What can be done with World Wide Web?
  2. Hypertext, Hyperlink, and Hypermedia
  3. Hypertext Markup Language (HTML)
  4. Introduction to Dynamic HTML
  5. Web Interface to Database Linking
  6. Introduction to XML
  7. XML Document Design
  8. Multimedia Web Resources
  9. Web Servers
  10. Website Hosting
  11. Tools for Web Page Designing

13 Multilingual Content Development (Using Unicode)

  1. Character Representation in Computer
  2. American Standard Code for Information Interchange (ASCII)
  3. Indian Scenario and Indian Standard Code for Information Interchange (ISCII)
  4. UNICODE
  5. Web Content Development Through UNICODE
  6. Applications of UNICODE
  7. Applying UNICODE to the Libraries
  8. Problems Associated with UNICODE

14 ISAR Systems- Objectives, Types, Operations and Design

  1. Users and Their Information Needs
  2. Objectives of ISAR Systems
  3. Types of ISAR Systems
  4. Design of ISAR Systems
  5. Evaluation of ISAR Systems

15 Compatibility of ISAR Systems

  1. Need for Compatibility Among ISAR Systems
  2. Scope of Compatibility in ISAR Systems
  3. Areas of Compatibilities in ISAR Systems
  4. Principal Issues of Compatibility in ISAR Systems
  5. Compatibility of Online IR Systems
  6. Approaches Towards Compatibility in ISAR
  7. Quality Control and Compatibility

16 Intelligent Information Retrieval Systems

  1. Introduction
  2. Expert Systems
  3. Expert Systems for Information Processing and Retrieval
  4. Components of Expert Systems
  5. Knowledge Representation
  6. Knowledge Engineering
  7. Artificial Intelligence Based Decision Support Systems (DSS)
  8. Pattern Recognition

17 Information Retrieval Processes and Techniques

  1. Information Retrieval Systems
  2. Databases
  3. Information Retrieval Systems: Purpose, Components, and Functions
  4. Indexing and Information Representation
  5. Vocabulary Control
  6. Searching
  7. Information Seeking and User Interfaces
  8. Web Information Retrieval Systems
  9. Intelligent Information Retrieval

18 Information Retrieval Models and Their Applications

  1. Information Retrieval
  2. Information Retrieval Techniques
  3. Models Based on Input/Output
  4. Models Based on Theories and Tools

19 Search Strategies, Processes and Techinques

  1. Search File – An Essential Component
  2. Search Strategies and Pre-requisites
  3. Search Techniques
  4. The Information Search Process
  5. Online Searching
  6. How the Search Engines Work
  7. Common Search and Retrieval Features of Web Search Engines