Difference Between XML and HTML

In this post, we will understand the difference between HTML and XML.


  • It refers to Hyper Text Markup Language.

  • It helps create web pages and applications.

  • It is a markup language.

  • It helps create static pages as well.

  • It helps display data.

  • It doesn’t transport data.

  • HyperText helps define link between multiple web pages.

  • Markup Language helps define text document using tags, which gives a structure to the web page.

  • It helps annotate the text so that a system can understand it and use it.

  • It ignores minor errors.

  • It is not case sensitive.

  • There are specific number of tags in HTML.

  • These tags are predefined.

  • It doesn’t preserve white spaces.

  • Closing tags are not a necessity.

An example of HTML −


<!DOCTYPE html>
   <title>My title</title>
   <p>A sample</p>



  • XML stands for ‘eXtensible Markup Language’.

  • It is case sensitive.

  • It doesn’t allow errors.

  • It helps provide a framework that would define markup languages.

  • The tags are user defined.

  • These tags are extensible.

  • The white space can be preserved.

  • The tags help describe data.

  • These tags aren’t used to display data.

  • The closing tags are required.

  • It helps create web pages and applications.

  • It is dynamic since it helps transport data.

  • The design goals focus on simplicity, usability across internet.

  • It supports Unicode.

  • It can also be used to represent arbitrary data structures required for web services.

An example of XML −


<?xml version = "1.0"?>
   <address category = "type">