Is HTML a Programming Language? (And What About CSS?)

By Marko Denic
Contents
  1. What HTML looks like
  2. What a programming language looks like
  3. HTML vs CSS vs JavaScript
  4. Is CSS a programming language?
  5. CSS that looks a lot like logic
  6. Does it matter?
  7. FAQ

No, HTML is not a programming language. It’s a markup language, which is what the “ML” in HTML (HyperText Markup Language) stands for. HTML describes what content is: this is a heading, this is a paragraph, this is a link. It doesn’t tell the computer to do anything. Even <em> only marks stressed words; showing them as italic text is just the browser’s default style.

A programming language has logic: it stores values in variables, makes decisions with if, repeats work with loops, and computes new results. HTML has none of that. Write the same HTML twice and you always get the same page.

What HTML looks like

Every tag labels a piece of content. Nothing here is calculated or decided; the browser just reads the structure and displays it. Even HTML comments are just notes the browser skips, not instructions. A blockquote, for example, marks a quotation; its indent is only the browser’s default style.

html
<article>
  <h1>My first post</h1>
  <p>HTML describes <strong>structure</strong>.</p>
  <a href="/blog/">Read more</a>
</article>

What a programming language looks like

JavaScript, by contrast, stores data, makes decisions and repeats work. The output depends on the input, which is what makes it a programming language.

javascript
const posts = ['HTML', 'CSS', 'JavaScript'];

for (const title of posts) {
  if (title.length > 3) {
    console.log(`${title} has ${title.length} letters`);
  }
}

HTML vs CSS vs JavaScript

The three languages of the web each have one job. A useful way to remember it: HTML is the skeleton, CSS is the skin and clothes, JavaScript is the muscles.

HTML CSS JavaScript
Type Markup language Style sheet language Programming language
Job Structure and meaning Appearance and layout Behavior and logic
Variables No Yes (custom properties) Yes
Conditions No Limited (media queries, :has(), if()) Yes
Loops No No Yes
Example <button>Buy</button> button { color: blue; } button.onclick = buy;

Is CSS a programming language?

This one is a closer call, and developers genuinely disagree. CSS is officially a style sheet language, and it’s declarative: you describe the result you want and the browser works out how to get there. But modern CSS has picked up a lot of programming-like features:

  • Variables with custom properties: --brand: #1d4ed8;
  • Math with calc(), min(), max() and clamp()
  • Conditions with media and container queries, the :has() selector, and the new CSS if() function
  • Functions are on the way, with the @function rule

It still has no loops and no general-purpose way to process data, so most people put it in its own category. People have even shown that HTML and CSS together can simulate a simple Turing-complete system, but only with a person clicking to move every step forward, which is more a clever trick than a sign that CSS is for programming.

CSS that looks a lot like logic

Variables, math and conditions in plain CSS:

css
:root {
  --gap: 16px;
}

.card {
  padding: calc(var(--gap) * 2);
}

/* "If the card contains an image, use two columns" */
.card:has(img) {
  display: grid;
  grid-template-columns: 1fr 2fr;
}

/* "If the screen is narrow, stack them" */
@media (max-width: 600px) {
  .card:has(img) {
    grid-template-columns: 1fr;
  }
}

Does it matter?

Not much, outside of online arguments. Calling HTML “not a programming language” isn’t saying it’s easy or unimportant. Good HTML is the base of accessibility, SEO and performance, and plenty of experienced developers write poor HTML. Front-end jobs expect you to know all three languages well. And as AI writes more of the code, knowing them well enough to review it matters more, not less (see will AI replace programmers).

What the distinction does tell you is the order to learn them in:

  1. HTML: structure, semantic tags, forms (start with these HTML tips and HTML input types)
  2. CSS: layout with Flexbox and Grid, responsive design (the CSS tutorial covers the basics)
  3. JavaScript: your first real programming language, where variables, conditions and loops come in

If you’re planning the whole journey, here’s how to go from zero to web developer.

FAQ

Is HTML a programming language or a markup language?

A markup language. It structures and labels content, but it has no variables, conditions or loops, so it can’t express logic.

Is HTML coding?

Yes. Writing HTML is coding: you write code that a computer reads, following strict rules. It’s just not programming in the sense of writing logic.

Is CSS a programming language?

Officially it’s a style sheet language. It has variables, math and some conditional features, but no loops or general data processing, so most developers don’t count it as a full programming language.

Can I put HTML and CSS on my resume as programming languages?

List them under “languages” or “skills” next to JavaScript; nobody reading a front-end resume will mind. Avoid calling yourself a programmer if HTML and CSS are all you know, though.

What is the easiest programming language to learn after HTML?

JavaScript. It runs in the same browser, works directly with your HTML and CSS, and you can see results instantly.