Your support for our advertisers helps cover the cost of hosting, research, and maintenance of this FAQ

The XML FAQ — Frequently-Asked Questions about the Extensible Markup Language

Section 1: Basics

Q 1.9: Aren't XML, SGML, and HTML all the same thing?

No, SGML and XML are metalanguages. HTML, XHTML, and HTML are all applications of them.

Not quite; SGML is the mother tongue, and has been used for describing thousands of different document types in many fields of human activity, from transcriptions of ancient Irish manuscripts to the technical documentation for stealth bombers, and from patients' medical and clinical records to musical notation. SGML is very large and complex, however, and overkill for most common office desktop applications.

XML is an abbreviated version of SGML, to make it easier to use over the Web, easier for you to define your own document types, and easier for programmers to write programs to handle them. It omits all the complex and less-used options of SGML in return for the benefits of being easier to write applications for, easier to understand, and more suited to delivery and interoperability over the Web. But it is still based on SGML, and XML files may still be processed in the same way as any other SGML file (see the question on XML software).

HTML, XHTML, and HTML5 are just those XML applications most frequently used on the Web.

Technical readers may find it more useful to think of XML as being SGML−− rather than HTML++.

(Ed: In respect of this last paragraph, see What is the difference between XML and C or C++ or Java? and How do I execute or run an XML file?.)