What is XML?
XML stands for eXtensible Markup Language.
XML is a way to structure and store data using tags, kind of like HTML and kind of like JSON. It was really popular in the early 2000s for sending data between computers and storing configuration files.
Here’s what XML looks like:
<person>
<name>Alice</name>
<age>30</age>
<email>[email protected]</email>
</person>
Everything has opening and closing tags. It’s verbose and takes up a lot of space, but it’s human-readable and computers can parse it.
XML was everywhere in the 2000s. Web services used it, configuration files used it (like Java’s Spring framework), and it was the standard way to exchange data between systems. Microsoft Office documents are actually just ZIP files full of XML.
Then JSON came along and killed it. JSON is simpler, easier to read, and takes up way less space. Here’s that same data in JSON:
{
"name": "Alice",
"age": 30,
"email": "[email protected]"
}
JSON won because it’s easier to read, especially for web developers who also know JavaScript, and it works naturally with web applications. By the 2010s, most new APIs were using JSON instead of XML.
You still see XML in older systems and certain industries that have been using it forever and don’t want to switch. But for new projects, basically everyone uses JSON now.