
Markup languages structure and organize information on the web and in other digital environments. Examples include HTML, XML, and Markdown. Programming languages such as Python, Java, and C# describe computations, process data, and control how applications behave. Markup describes the structure and meaning of a document.
1. What is a markup language?
A markup language uses tags or other markers to describe the parts of a document, such as headings, paragraphs, links, or data fields. The words of the document can be written in any natural language. The markers follow a syntax that software can interpret.
Markup and character encoding do different jobs. Markup tells software what a piece of content represents. A character encoding such as UTF-8 specifies how characters are represented as bytes.
1.1. Examples of markup languages
| Area | Language | Typical use |
|---|---|---|
| Documents | HTML | Structures web pages |
| Documents | Markdown | Adds lightweight formatting to plain text, such as a README |
| Documents | LaTeX | Typesets scientific and technical documents |
| Data and applications | XML | Represents and exchanges structured data |
| Data and applications | RSS | Distributes updates from a website in a feed |
| Data and applications | XAML | Describes interfaces for some Windows applications |
| Specialized | SVG | Represents scalable vector graphics |
| Specialized | MathML | Represents mathematical expressions |
| Specialized | CALS | Standardizes technical documentation and tables in some industries |
1.2. Characteristics of markup languages
Markup is commonly stored in plain-text files that can be edited with a text editor. The markers and content can live in the same file. Compare how HTML, Markdown, and XML represent a heading and a short paragraph.
HTML
<h1>Page title</h1>
<p>This is an example paragraph.</p>
Markdown
# Page title
This is an example paragraph.
XML
<document>
<title>Page title</title>
<content>This is an example paragraph.</content>
</document>
HTML defines a standard set of elements, so <h1> means a top-level heading. Markdown uses # for a similar purpose. XML lets you define names such as <title> and <content> to suit the data you need to represent.
2. Practice exercises
2.1. Create your first HTML page in a text editor
Open a plain-text editor such as Notepad on Windows or TextEdit in plain-text mode on macOS. Enter the example and save it as example.html. In Notepad, choose “All files” if it tries to append .txt. Double-click your saved file to open it in a browser.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>HTML example</title>
</head>
<body>
<h1>Article title</h1>
<p>This paragraph introduces basic Markdown syntax.</p>
<h2>Markdown elements</h2>
<ul>
<li>Headings</li>
<li>Paragraphs</li>
<li>Lists</li>
</ul>
</body>
</html>
The browser should display a main heading, a paragraph, a second-level heading, and a list. Change the text in your editor, save the file, and refresh the browser to see the result.
2.2. Quick check: markup languages
Which language uses # for a heading? Which one lets you define your own element names? Which language tells the browser that <h1> is a heading? Compare your answers with the three examples above.