You open your first coding tutorial. You're ready to build the next big app. And the very first thing it asks you to do is make the computer print two words: hello, world. That's it. No app. No game. Just a polite greeting to nobody in particular.
Short answer: "Hello, world" is the traditional first program in almost every programming language. It does one thing, print the words "hello, world" on the screen, and its real job is to prove your setup works. If those two words show up, your editor, your compiler or interpreter and your computer are all talking to each other. If they don't, you've found a problem before writing anything complicated.
So what does hello world mean, and why did a whole industry agree on these exact two words? The answer involves Bell Labs in the early 1970s, a programming language that could only hold four letters at a time, and a cartoon chick that may or may not have existed.
What Does Hello World Mean?
Literally? It's a greeting. The program is saying hi to the world, like a newborn announcing it has arrived. (That image matters later in the story.)
In practice, "hello world" means two things to programmers:
- The program itself. A "hello world program" is the smallest complete program you can write in a language that produces visible output. In Python it's one line. In C it's about five.
- The first step of anything. Programmers use "hello world" as shorthand for the most basic working version of something new. Got a web server to return a single page? That's your hello world. Got a tiny circuit board to blink one light? Same thing.
Here's the classic version in C, the language that made it famous:
#include <stdio.h>
int main(void) {
printf("hello, world\n");
return 0;
}The \n at the end is a newline, so your prompt doesn't end up glued to the greeting. Everything else is the minimum C needs to start a program and print a line of text.
Why Is Hello World the First Program?
It looks like a silly ritual. It's actually a smart test. When you're new to a language, the hard part usually isn't the code. It's everything around the code.
Hello world checks that whole chain at once:
- You can write a file the language understands, saved with the right name and extension.
- The language tools are installed and you can find them. Missing compilers and wrong PATH settings kill more beginner projects than bad code does.
- The program actually runs on your machine.
- Output reaches you. You can see what the program printed, which is how you'll debug everything later.
If any link in that chain is broken, you find out with a two word program instead of a 400 line one. That's a huge favor to your future self. When a bigger project fails, you'll be debugging your code, not your setup. (We covered the usual suspects for that in Why Doesn't My Code Work?)
It's also a quick way to get a feel for a language. Same job, very different amounts of ceremony:

Where Did Hello World Come From?
This is where it gets good. Hello world has a documented paper trail, plus a few stories that are more folklore than fact. We'll keep those labeled.
1972: The B language tutorial
The earliest known hello world comes from Brian Kernighan, a computer scientist at Bell Labs in New Jersey, the same lab that gave us Unix. In 1972 he wrote A Tutorial Introduction to the Language B. (You'll sometimes see it dated 1973.) B was the language that came right before C.
B had a weird limitation. A "character" constant could hold only one to four ASCII characters. So "hello, world" didn't fit in one piece. Kernighan's example had to chop the greeting into three chunks, stash each one in a separate variable, and print them one after another:
main( ) {
extrn a, b, c;
putchar(a); putchar(b); putchar(c); putchar('!*n');
}
a 'hell';
b 'o, w';
c 'orld';Fun detail: the tutorial's first output example printed just hi!, because that fits in four characters. Hello world was the follow up, used to show off external variables. Here's what those chunks look like as raw bytes:

And yes, that '!*n' at the end means the original actually ended in an exclamation point. In B, *n was the newline, the ancestor of C's \n. If you want to know what those hex numbers are doing, our ASCII vs Unicode explainer covers how letters become bytes.
1974: The C tutorial
Two years later Kernighan wrote an internal Bell Labs memo called Programming in C: A Tutorial. The very first example program is basically the modern one:
main( ) {
printf("hello, world");
}C could handle a whole string at once, so no more chopping. Notice there's no exclamation point this time and everything is lowercase.
1978: The book that made it famous
In 1978 Kernighan and Dennis Ritchie (C's creator) published The C Programming Language, a book so influential that programmers just call it "K&R." Chapter 1 opens with hello world, and the book points out that this first program is the same in every language: print the words "hello, world."
K&R taught a generation of programmers C. Those programmers went on to write tutorials and books for other languages, and they kept the tradition. That's how a Bell Labs example became a global habit.
But why those two words?
Here's where documented history runs out. Kernighan has said himself that he doesn't clearly remember why he picked the phrase. In an interview quoted by HackerRank, he recalled seeing a cartoon of an egg and a chick, with the chick saying "Hello, World." Nobody has ever tracked that cartoon down, so treat it as a fond memory, not a source.
A few other origin stories float around. Label these all as folklore:
- BCPL in 1967. The Jargon File, the classic dictionary of hacker slang, says hello world started with BCPL, the language that inspired B. No surviving BCPL example from that era has been produced to back it up.
- A radio DJ. New York disc jockey William B. Williams opened his 1950s shows with "Hello, World!" It's a fun coincidence. There's no evidence Kernighan was a listener.
What we can say for sure: the first written hello world we can point to is Kernighan's, and K&R is what made it stick.
What Actually Happens When Hello World Runs?
Hello world looks like nothing. Under the hood, it's a decent tour of how a computer works. We compiled the C version and watched it with strace, a Linux tool that lists every request a program makes to the operating system (those requests are called system calls).

A few things jump out:
- The greeting is a single
write. Thirteen bytes (twelve characters plus the newline) sent to file descriptor 1, which is the program's standard output, aka your terminal. - Most of the work is setup. The rest of the trace is the program loading the C library, mapping memory and getting ready to run. Printing is the easy part.
- The program is bigger than its message. Our compiled hello world came out at 15,960 bytes on this Linux machine. That's over a thousand times the size of the 13 bytes it prints. Your number will vary by compiler and system.
That's the secret value of hello world. Once it runs, every one of those moving parts has been proven to work.
Hello World in Different Languages
Some languages make hello world a single line. Others want you to declare a class, a function and a package first. A quick comparison:
| Language | Hello world | Ceremony level |
|---|---|---|
| Python 3 | print("hello, world") | One line, done |
| JavaScript (Node.js) | console.log("hello, world"); | One line |
| Ruby | puts "hello, world" | One line, no parentheses needed |
| Bash | echo "hello, world" | One line, and you've used it already |
| C | printf("hello, world\n"); inside main | Include a header, write a function, compile |
| Go | fmt.Println("hello, world") inside main | Package, import and function first |
| Java | System.out.println("hello, world"); | A class and a public static void main first |
Even the punctuation wandered over the years. Kernighan's versions used lowercase with a comma. Today you'll see "Hello, World!", "Hello World" and every combination in between. No version is wrong. The computer doesn't care, and neither do we.
Hello World Beyond Your First Program
Once you notice hello world, you see it everywhere.
- Blogs. A fresh WordPress install creates a sample post titled "Hello world!" for you to edit or delete.
- Hardware. On tiny boards like Arduino, there's often no screen to print to, so the hello world is blinking an LED.
- Developer tools. Tool makers talk about time to hello world: how long it takes a brand new user to get the simplest possible thing working. Shorter is better, and a painful hello world is a warning sign.
- Language breakups. When Python 3 turned
print "hello"intoprint("hello"), the most famous program in the language stopped working on old code. Python 2 was officially retired at the start of 2020, so the parentheses won. - Joke languages. Malbolge, a language built in 1998 to be as hard to use as possible, was so nasty that the first hello world for it took about two years to show up, and a computer search found it, not a human.
Hello world also has a nice cousin in the placeholder world. When tutorials need meaningless names instead of meaningless greetings, they reach for foo and bar. Same spirit: keep the example so simple that only the lesson is left.
And if you want your coffee to speak the language your first program was eventually turned into, there's a mug for that:
FAQ
Who wrote the first hello world program?
The earliest known one is Brian Kernighan's, in his 1972 tutorial for the B language at Bell Labs. A claim that it started with BCPL in 1967 has never been backed up with an actual example.
Is it "Hello World" or "hello, world"?
The originals were lowercase with a comma: "hello, world." The capitalized "Hello, World!" version is more common today. Both count, and your program will run either way.
Why does every programming tutorial start with hello world?
Because it's the smallest program that proves your whole setup works. If it prints, your tools are installed, your file runs and you can see output. Then the real lessons can start.
What does "hello world" mean in slang?
Outside of code, people use it to mean "the first working version" or "my first post." A new blog's first entry or a new project's first demo is often called its hello world.
Is hello world a real program?
Yes. It's tiny, but it's complete. It compiles or runs, talks to the operating system and produces output, which is everything a program fundamentally does.
TL;DR
"Hello, world" is the traditional first program: it prints two words to prove your coding setup works before you try anything harder. It started with Brian Kernighan's 1972 B tutorial at Bell Labs, where the greeting had to be split into four letter chunks, then got famous through his 1978 C book with Dennis Ritchie. Why those exact words is fuzzy, possibly a cartoon chick, so enjoy the legend and go print something.