What Is .xht
Content on WhatAnswers is provided "as is" for informational purposes. While we strive for accuracy, we make no guarantees. Content is AI-assisted and should not be used as professional advice.
Last updated: April 11, 2026
Key Facts
- XHTML 1.0 became a W3C official recommendation on January 26, 2000, with a revised edition released August 1, 2002
- XHTML is an XML application rather than SGML application, requiring stricter syntax and error handling than traditional HTML
- XHTML 1.1 was published May 31, 2001, introducing modularization capabilities based on W3C's Modularization of XHTML specification
- The W3C retired XHTML 1.0 and 1.1 recommendations on March 27, 2018, shifting focus to HTML5 and XHTML5 development
- XHTML uses MIME type application/xhtml+xml and supports both .xht and .xhtml file extensions with UTF-8 encoding
Overview
.xht is the file extension for XHTML (eXtensible HyperText Markup Language) documents, a reformulation of HTML that adheres to the stricter rules of XML. Introduced by the World Wide Web Consortium (W3C) in the late 1990s, XHTML brought greater consistency to web content by requiring well-formed, valid markup that could be processed by standard XML tools and applications.
Unlike traditional HTML, which was derived from SGML and allowed browsers to overlook many syntax errors, XHTML enforces strict compliance with XML rules. This stricter approach was designed to make web pages more interoperable with various devices and platforms, particularly mobile phones and constrained systems that needed reliable, consistent content structure. XHTML files are plain text documents typically encoded in UTF-8 and can be edited with any text editor that supports Unicode.
How It Works
XHTML operates on several core principles that distinguish it from HTML:
- XML Compliance: XHTML documents must be well-formed XML, meaning all tags must be properly closed, nested elements must be ordered correctly, and all attributes must use quoted values. This eliminates the forgiving error tolerance that browsers traditionally provided for HTML.
- Strict Syntax Rules: Elements like
,, and must be self-closing with a forward slash (for example,
instead of
). Tags must be lowercase, and improper nesting results in document errors rather than browser interpretation attempts. - MIME Type Declaration: XHTML documents are served with the MIME type application/xhtml+xml, which tells browsers to process the document as strict XML rather than lenient HTML. This ensures proper parsing and error reporting.
- DOCTYPE Declaration: XHTML requires explicit DOCTYPE declarations specifying whether the document uses Strict, Transitional, or Frameset variants. These declarations define which elements and attributes are permitted in the document.
- Namespace Support: XHTML documents can embed content from other XML namespaces, allowing integration with SVG graphics, MathML equations, and other XML vocabularies without creating hybrid or proprietary formats.
Key Comparisons
| Feature | XHTML (.xht) | HTML | HTML5 |
|---|---|---|---|
| Base Technology | XML application | SGML application | Living standard with HTML and XML variants |
| Error Handling | Strict, fails on malformed markup | Lenient, attempts to parse errors | Lenient by default, XML variant available |
| Tag Closure Requirements | All tags must be closed (e.g., ) | Some tags can remain open | Flexible, both styles accepted |
| W3C Recommendation Status | Retired March 27, 2018 | Retired March 27, 2018 | Active living standard |
| Device Compatibility | Designed for diverse devices | Browser-dependent | Universal modern browser support |
| XML Tool Integration | Full XML toolkit support | Limited XML tool support | Partial XML support |
Why It Matters
- Standards Compliance: XHTML represented an important effort to enforce consistent web standards, reducing browser compatibility issues and making web content more predictable and maintainable across different platforms and devices.
- Data Interoperability: By adopting XML syntax, XHTML enabled web documents to be processed by the same tools used for other XML data formats, facilitating content transformation, validation, and repurposing across systems.
- Mobile and Constrained Devices: The strict, well-formed nature of XHTML made it ideal for serving content to mobile phones and other resource-limited devices that needed reliable, predictable markup to parse efficiently.
- Legacy Web Content: Millions of web pages were created in XHTML format throughout the 2000s and early 2010s, and many remain in use today. Understanding XHTML is still relevant for maintaining older websites and archives.
While XHTML is no longer an active W3C recommendation as of March 2018, it represents a significant chapter in web standards history. The lessons learned from XHTML's development—particularly regarding the value of consistent standards and the challenges of enforcing strict syntax in web environments—influenced the design of HTML5 and its XML variant, XHTML5. Today, .xht files serve primarily as legacy content, though the principles of well-formed markup that XHTML championed remain relevant to modern web development.
More What Is in Daily Life
Also in Daily Life
More "What Is" Questions
Trending on WhatAnswers
Browse by Topic
Browse by Question Type
Sources
- XHTML - WikipediaCC-BY-SA-4.0
- XHTML 1.0 - W3C StandardsW3C-License
- XHT File Format - FileFormat.comCC-BY-4.0
Missing an answer?
Suggest a question and we'll generate an answer for it.