How to learn coding online
Quick answer
Pick one beginner-friendly language, usually Python or JavaScript, and follow one structured free course such as freeCodeCamp, Harvard’s CS50 or The Odin Project from start to finish. Practice a little every day and start building small projects as soon as you can.
The biggest mistake beginners make isn’t picking the wrong language. It’s hopping between ten tutorials and finishing none.
Which programming language should you learn first?
| Goal | Start with |
|---|---|
| Not sure yet / general programming | Python |
| Websites and web apps | HTML, CSS, then JavaScript |
| Data analysis and AI | Python |
| iPhone apps | Swift |
| Android apps | Kotlin |
| Games | C# (with the Unity engine) |
Once you know one language well, the second one is far easier, because the core ideas are the same.
The best free places to learn coding
- freeCodeCamp: Thousands of hours of free lessons with certifications in web development, Python and more.
- Harvard’s CS50: A famous intro to computer science, free to watch and complete online through edX.
- The Odin Project: A free, project-based path for full-stack web development.
- MDN Web Docs: Mozilla’s reference and tutorials for HTML, CSS and JavaScript.
- Khan Academy: Gentle, interactive intros, good for younger learners.
A simple study plan
- Weeks 1–4: Learn the basics: variables, loops, conditions, functions.
- Weeks 5–8: Build tiny projects: a calculator, a to-do list, a number guessing game.
- Months 3–6: Build one bigger project you actually care about and put it online.
- Ongoing: Read other people’s code, and share yours on GitHub.
How long does it take to learn coding?
With about an hour a day, most people can write simple programs within a couple of months. Getting job-ready usually takes six months to two years of steady practice, depending on the field and how much time you put in.
A good first real project? Build your own site. Here’s how to start a blog.
Still curious?
Jump to a random question from the archive.