# XML

> A text format that wraps data in named tags, so both people and programs can read it.

- Level: Basic
- Topics: Data, Software
- URL: https://tidbit.legios.com.ar/xml/
- In Spanish: [XML](https://tidbit.legios.com.ar/es/xml/)

**XML** (Extensible Markup Language) is a way to write structured data as plain text, using tags in angle brackets. Each piece of information sits between an opening tag and a closing tag with a name you choose: a `title` tag holding "Dune", inside a `book` tag, inside a `library` tag. The closing tag repeats the name with a slash. Because tags can be nested, XML can describe almost any shape of data as a tree.

It was standardized by the W3C in 1998 and became the common language for exchanging data between companies and systems. It is still everywhere, often out of sight: Word and Excel files (`.docx`, `.xlsx`) are zipped folders of XML, RSS feeds and sitemaps are XML, SVG images like the one on this page are XML, and many banks, governments and electronic invoice systems exchange XML documents.

For new web APIs, JSON has mostly taken its place, because it is shorter and maps directly to the objects programmers use. XML is more verbose, but it brings tools JSON lacks out of the box, such as schemas that strictly validate a document and attributes inside tags. That rigor is why it survives in formal, long-lived document exchanges.

## An analogy

Labeled envelopes inside labeled envelopes: a big one that says "book", holding smaller ones that say "title" and "author". Anyone can open them and know exactly what each piece of paper is.

## Keep in mind

- Plain text with named opening and closing tags, nested like a tree.
- A W3C standard since 1998, still used for documents, feeds, invoices and SVG.
- Office files like .docx and .xlsx are XML inside a zip.
- JSON replaced it in most web APIs; XML remains where strict validation matters.

## Go deeper

- [XML on Wikipedia](https://en.wikipedia.org/wiki/XML)
- [XML introduction (MDN)](https://developer.mozilla.org/en-US/docs/Web/XML/Guides/XML_introduction)
- [XML at the W3C](https://www.w3.org/XML/)

## Related terms

- [Spreadsheet vs database](https://tidbit.legios.com.ar/spreadsheet-vs-database/): Why a company that runs on Excel eventually needs a real database.
- [API](https://tidbit.legios.com.ar/api/): The menu of things one program lets another program ask for.
- [JSON](https://tidbit.legios.com.ar/json/): The plain-text format programs use to hand each other structured data.
- [Database schema](https://tidbit.legios.com.ar/database-schema/): The blueprint of a database: which tables exist, their columns and how they connect.
