HTML defines the structure of web pages online. Depending on your age, you might know HTML as “that stuff you used to style your Myspace profile” (been there).
But what is it really? Is HTML a programming language? It’s a bit of a hot topic, actually, depending who you talk to.
In this article we’ll dive into what HTML is and how it’s used. We’ll also present both sides of the “is HTML a programming language?” argument, so you can decide for yourself!
You can click on a heading below to jump directly to that section:
- What is HTML?
- So, is HTML a programming language?
- Why HTML might not be considered a programming language
- What about a coding language? Are HTML and CSS considered coding?
- Should new coders learn HTML?
- How to learn HTML and CSS
- Final thoughts
1. What is HTML?
HTML stands for HyperText Markup Language.
Okay, but what is the text and why is it hyper? Hypertext is actually a piece of text that is used to reference another piece of text. Specifically, it’s text that contains links (hyperlinks) to other text. It can include graphics, video and sound. Markup language tells the browser what the structure and style of the webpage is.
If a website was a house, HTML would be the beams defining its shape. It’s made up of a series of elements that tell the browser how to display content. When you wrap HTML around something, you’re saying “This is a heading”, “this is a link”, “here is a new paragraph”, etc.
If you want to learn more about how it works, then take a look at our beginner’s guide to HTML.
An HTML element includes a start tag, some content, and an end tag. Here is an example of a very simple blog article online:
<body> <h1>My main blog article title</h1> <p> <h2>Here is a subheading</h2> </p> <p>This is a paragraph underneath my subheading</p> <p> <h2>Another subheading</h2> <p>Here is more stuff I have to say, but <b>say it in bold.</b></p> </p> </body>
In this example we have the body tag, which contains all the content of our HTML document. We have the <h1> tag, of which there should only ever be one per page, that tells us this is the main title.
The <p> tags tell us it’s a new paragraph, and the <h2> tags tell us the text is a subheading (there are also h3, h4, etc, tags for subheadings within subheadings).
There are many different types of HTML elements than this, but this gives you an idea how HTML is used.
If you want to kick off your learning journey, this video from our in-house web developer Abhi will get you building your first webpage:
2. So, is HTML a programming language?
This ultimately depends on your definition of a programming language. Let’s consider that for a minute.
What is a programming language?
A programming language, at its core, is a set of syntactical rules. These rules instruct a computer to perform specific tasks. Each programming language has its own set of keywords it understands. These help it organize instructions. Just the same way as with human language, we use programming languages to communicate with computers.
Programming languages come in two main types: low-level and high-level.
Low-level programming languages
Low-level programming languages are your 0s and 1s. A processor can run these languages directly without a compiler or interpreter. These languages are very fast for this reason, but can be hard for humans to understand.
High-level programming languages
That’s why high-level programming languages exist. These languages are more user-friendly and readable for humans. They need a compiler or interpreter to translate the language into machine language.
What is Turing complete?
Turing completeness is a concept from theoretical computer science. People use it to define what is and is not a programming language. It tells you how powerful a programming language is.
The name Turing comes from Alan Turing, who invented the Turing machine back in the 1930s. His machine could take a program and run it, then show a result. At first he had to create different machines for different programs. This was obviously not ideal, so he created a “Universal Turing Machine”, which can take any program and run it.
You can think of programming languages like these machines. They take instructions (programs) and run them. A programming language is considered “Turing complete”, if it can run any program that a Turing machine could run, given enough time and memory.
3. Why HTML might not be considered a programming language
Programming languages are Turing complete when they are able to run programs. Things like addition, multiplication, if-else conditions, return statements, storing/retrieving/deleting data, etc.
Can HTML do this? Well, not exactly. HTML by itself doesn’t really “do” anything, or contain any logic. It can’t do math, evaluate expressions, declare variables, create functions or manipulate data. You couldn’t do addition or subtraction with HTML. There is no way for HTML to take input and produce output.
We use HTML for structural purposes. Things like telling the browser which content is a header, a list, an image, and so on, but it’s not really functional.
To make a very long story short, HTML is not a programming language. At least according to Turing completeness. Now, the key term here is “programming”.
4. What about a coding language? Are HTML and CSS considered coding?
HTML is often combined with CSS, i.e. Cascading Style Sheets. As we learned in our beginner’s guide to CSS, it describes how HTML elements should be displayed on the screen.
So, we just said HTML is not a programming language (though some argue HTML combined with CSS3 specifically is Turing complete).
But what about a coding language? When we write HTML combined with CSS, are we coding?
When you write HTML and CSS, you’re still writing lines of code, albeit in a markup language, not a programming language. At its core, you’re still codifying information to be used in the browser. HTML is a major part of front-end development.
So yes, you can consider HTML and CSS coding. Some also argue that HTML is a declarative programming language. A declarative programming language lets you express what you want done, but not how you want it done.
5. Should new coders learn HTML?
Every browser uses HTML, as it defines the structure of the web. Thus, understanding the basics of HTML is important for new coders. If you end up doing any type of web development, you should definitely learn HTML. Knowledge of HTML syntax will help you with other programming frameworks, too.
5. How to learn HTML and CSS
The great news is that for those starting off on their web development journey, these two technologies are some of the best ways in. Due to their aesthetic nature (HTML building a site and CSS styling it) you can start to view the results of your labor almost immediately.
For now, here are a few suggestions:
- CareerFoundry’s free 5-day Web Development Short Course
- freeCodeCamp’s HTML for Beginners Course
- Codeacademy’s HTML and CSS courses
The debate about whether HTML is a programming language rages on. To make a decision, you need to dive into theoretical computer science topics like Turing completeness. Some say HTML is a markup language, but not a programming language. Others, though, say that HTML is a declarative programming language.
Whatever you believe, HTML is a core part of web development, and certainly worth learning! That’s why it’s one of the first skills you’ll master in our fully mentored Full-Stack Web Development Program, which will take you from coding novice to professional developer in a little as five months full-time.
If you’d like to read more about the world of coding, check out these articles: