Every time you open a web page, fill out an online form, or read a digitised book in a library catalogue, you are interacting with a structured document. That structure does not appear by accident. Behind it sits decades of careful thinking about how to separate what a document means from how it looks. The technology that formalised this idea is called the Standard Generalized Markup Language, or SGML. It is not flashy, and most people have never heard of it, yet it quietly shaped HTML, XML, and the way the entire web is organised. Understanding SGML helps you understand why digital documents behave the way they do.
Table of Contents
- What is SGML?
- A short history
- The meta-language idea explained
- Descriptive markup, not formatting
- The Document Type Definition
- Benefits of SGML
- Flexibility in defining tags
- Support for complex document structures
- Reusability and longevity
- SGML in libraries and publishing
- The Text Encoding Initiative
- Encoding texts for digital collections
- Metadata and the document header
- SGML and the structure of the web
What is SGML?
SGML stands for Standard Generalized Markup Language. It is an international standard for the definition of markup languages, formally published as ISO 8879 in 1986. The word “markup” simply refers to codes, usually called tags, that are inserted into a text to describe its parts or control how it should be processed.
Here is the key point that makes SGML special. It is not a markup language in the way HTML is. Instead, it is a meta-language: a language used to define other markup languages. In other words, SGML does not give you a fixed set of tags. It gives you the rules for inventing your own tags and deciding how they may be combined. HTML, for example, is one specific language built using SGML principles, while XML is a simplified dialect of SGML often described as “SGML-lite”.
A short history
SGML did not emerge overnight. Its roots go back to 1969, when Charles Goldfarb, Edward Mosher, and Raymond Lorie at IBM developed the Generalized Markup Language, or GML. Goldfarb later coined the term GML as an anagram of the three developers’ surname initials. Goldfarb is often called the father of SGML and the grandfather of HTML.
The original goal was practical. GML was meant to help large organisations, such as law offices and government bodies, share machine-readable documents that would stay readable for decades. Over several years of refinement, GML grew into SGML, and after an eight-year standardisation effort involving hundreds of people, the final version was accepted by the International Organization for Standardization in October 1986. SGML went on to be used heavily by the military, aerospace, technical publishing, and industrial sectors, where documents are huge, complex, and long-lived.
The meta-language idea explained
To understand why SGML is called a meta-language, it helps to look at how a markup language works. A markup language must answer four questions: what markup is allowed, what markup is required, how markup is distinguished from ordinary text, and what the markup actually means. SGML provides the means to handle the first three of these. The meaning of any given tag is then supplied by the specific language built on top of SGML.
This separation is powerful. SGML lets you define a vocabulary of tags suited to a particular kind of document. A scientific journal, a legal contract, a parliamentary record, and a novel all have very different structures. With SGML, each community can design tags that match its own needs, while still following a common, standardised set of underlying rules.
Descriptive markup, not formatting
One of SGML’s founding principles is that markup should describe a document’s structure, not its appearance. This is known as descriptive, or declarative, markup. ISO 8879 states that generalised markup should describe a document’s structure and attributes rather than specify the processing to be performed on it.
Consider a tag like <emphasis>. It does not say “make this italic” or “make this bold”. It simply records that a portion of text is emphasised. A computer screen might display that as reverse video, a typewriter might underline it, and a typeset book might render it in italics. Because the markup describes meaning rather than appearance, the same document can be reused across many different output formats. This is why SGML matters for documents that must remain readable for several decades, a long time in the world of computing.
The Document Type Definition
The heart of SGML’s flexibility is the Document Type Definition, or DTD. A DTD defines a particular kind of document by specifying which elements may appear and the rules governing their arrangement. For example, a DTD might state that a report must contain a title, or that a paragraph may appear inside a table cell but a table may not appear inside a paragraph.
Once a DTD exists, a parsing program can check a document against it to confirm that it follows the rules. This process, called validation, is one of SGML’s biggest strengths. It ensures that documents are consistent and well-formed before they are processed, stored, or published. The DTD is essentially a contract that every document of a given type must honour.
Benefits of SGML
SGML’s design delivers several clear advantages, especially for organisations that handle large volumes of structured information.
Flexibility in defining tags
Because SGML does not impose a fixed tag set, organisations can create vocabularies tailored to their exact requirements. A publisher of dictionaries, a manufacturer of aircraft manuals, and a digital library each design tags that fit their own content. This adaptability is the reason SGML found homes in fields as varied as aerospace engineering and defence documentation.
Support for complex document structures
SGML handles deeply nested and intricate structures with ease. A single technical manual might contain chapters, sections, subsections, figures, tables, cross-references, and footnotes, all nested within one another. SGML’s element and attribute system, governed by a DTD, can model all of this hierarchy precisely. Elements are the named blocks of content, while attributes add extra information to those elements, such as an identifier or a status value.
Reusability and longevity
Because SGML separates content from presentation, a document is not tied to any single software, device, or output format. The same source file can be turned into a printed book, a web page, or a database record. As the Text Encoding Initiative noted, the central idea behind SGML is to strictly separate the structure and contents of a document from its processing, which results in application-independent and reusable documents. For archives that must survive technology changes over many years, this is invaluable.
SGML in libraries and publishing
SGML found a natural home in libraries, archives, and academic publishing, where the structure of a text carries real meaning and must be preserved accurately. The connection became especially strong through a major scholarly project.
The Text Encoding Initiative
The Text Encoding Initiative, or TEI, was founded in 1987 to develop guidelines for encoding machine-readable texts of interest to the humanities and social sciences. When the TEI designed its encoding scheme, it made a deliberate choice. The first major decision was to adopt the recently published ISO SGML standard, which, despite its complexity, offered a unique platform for specifying and customising complex document structures.
The first editions of the TEI Guidelines used SGML directly. According to the TEI, this approach was replaced by XML from 2002 onward, since XML inherited the core ideas of SGML in a simpler form. The shift was smooth precisely because XML is a descendant of SGML, so the underlying philosophy of elements, attributes, and rules carried over intact.
Encoding texts for digital collections
Libraries used SGML to break a text down into its meaningful parts. The encoding records structural divisions such as volumes, chapters, paragraphs, line breaks, and pagination, creating a hierarchical structure based on the content’s meaning rather than its visual formatting. As one digital library guideline put it, the meaning and structure of a text should determine the encoding, not the formatting of the original page.
This structural tagging unlocks a powerful benefit for researchers. Because the markup identifies chapters, scenes, quotations, and other elements, a search program can restrict a search to a particular part of a text. As one university text centre explained, you cannot limit a search to a single chapter if there are no markers for chapter divisions, and you cannot view a quotation in the context of a scene if the scenes are not delimited. Structured markup turns a flat block of text into a richly navigable resource.
Metadata and the document header
SGML and TEI encoding also carry detailed metadata. A TEI document begins with a header that records information about both the electronic text and the original source it was created from, often drawn from the library’s catalogue and the title page of the original work. This is essentially structured metadata travelling inside the document itself, which makes digital collections far easier to manage, describe, and preserve. For this reason, studies of metadata approaches found that SGML-based methods offered the widest range of features and the broadest potential among the options then in use.
SGML and the structure of the web
The most far-reaching legacy of SGML is the web itself. HTML, the language of web pages, is a simple application built on SGML principles. It uses the same idea of tags enclosed in angle brackets to mark up the parts of a document. However, HTML is not a meta-language; it has a fixed set of tags and cannot be used to define new markup languages of its own.
SGML became the foundation for an entire family of markup languages. HTML, XML, and DocBook all trace back to the SGML specification. XML, developed from 1996 onward, was designed to combine the power and flexibility of SGML with the simplicity and popularity of HTML, removing the most complicated features while keeping the core strengths. Today XML and its descendants power countless data formats, configuration files, and document standards. So while you may never write SGML directly, its DNA is present every time a browser parses a tag and every time a library catalogue exchanges structured records.
What do you think? If SGML was designed so documents could stay readable for decades, how well do you think today’s web pages will survive the next thirty years of technology change? And in a world increasingly run on XML and JSON, is it worth knowing the older meta-language that made them possible?
References
- https://www.britannica.com/technology/computer-programming-language/SGML
- https://www.unescwa.org/sd-glossary/standard-generalized-markup-language
- https://www.ithistory.org/honor-roll/dr-charles-f-goldfarb
- https://www.historyofinformation.com/detail.php?id=2425
- https://image-ppubs.uspto.gov/dirsearch-public/print/downloadPdf/6209095
- https://en.wikipedia.org/wiki/Standard_Generalized_Markup_Language
- https://en.wikipedia.org/wiki/Charles_Goldfarb
- https://www.academia.edu/3735509/Lessons_Learned_from_using_SGML_in_the_Text_Encoding_Initiative_with_David_T_Barnard_C_Michael_Sperberg_McQueen_et_al_
- https://arxiv.org/pdf/1403.0052
- https://tei-c.org/release/doc/tei-p5-exemplars/html/tei_lite.doc.html
- https://docsouth.unc.edu/support/guidelines/encoding.html
- https://cdrh.unl.edu/TEI/
- https://www.htmlwasher.com/history-of-html/

Leave a Reply