Skip to content
AITermsLab
–points–day streak

What is code?

Code is written instructions that tell a computer exactly what to do, in a language it understands, like HTML for a page's content or Python for a task.

Last updated

In real life

Like a recipe: step-by-step instructions, written so precisely that the cook, here the computer, can follow them without guessing.

Try it yourself

The demo shows three lines of code for a bakery's web page next to a preview. Change the heading text, the button's words or its colour, and the matching line of code changes and the preview updates straight away.

Change a line

Line 3: the button's colour

index.html (the code)

1<h1>Rosa's Bakery</h1>2<p>Fresh bread every morning</p>3<button style="background: yellow">Order now</button>

The preview (what visitors see)

Rosa's Bakery

Fresh bread every morning

Order now

Code is just written instructions. Change the heading, the button's words or its colour: the matching line changes, and the preview follows straight away.

Code vs program

Code is the written instructions, line by line. A program, or app, is what you get when that code runs: something you can open, click and use.

Common questions

Do I need to learn to code to build things?

Less than you used to. AI tools can write code from a description, but knowing what a few lines do helps you check and fix what they make.

Is HTML code?

Yes. HTML is code that describes a page's content. It isn't a programming language, because it doesn't make decisions or repeat steps, but it's still code.

Where you will use this

Quick check: Code

Question 1 of 3

What is code?

What is code?