The Code Lab: Learn to Program
Pick a language and your level, then learn by running code. JavaScript has a sandboxed playground, an execution visualizer, graded lessons and a code inspector; Python has the visualizer and the inspector.
How to Use
- Run the playground. A FizzBuzz program has already run when the page opens; its output, run time and step count are in the readouts. Pick another preset or type your own JavaScript and press Run (or Ctrl+Enter).
- Pick your language. Each card says how much is live: JavaScript has all 4 experiences, Python has 2 (visualizer and inspector), the other 16 are planned.
- Pick your level. Never Coded, Beginner, Intermediate or Advanced. The level sets the starter program and where the lessons and visualizer open.
- Press Enter the Lab. Live experiences open the real tool at your level; the strip below lists the Bunker tools that pair with that language.
- Read Show Work for the run log of your program: every output line, the time it took in the sandbox, and how many steps the Execution Visualizer traces for it.
- Your choice is remembered on this device and the address is shareable, for example
?lang=python&level=beginner.
Learn to program in your browser. Pick a language and the level you’re at and the Code Lab routes you to the right way to learn: step through code in the visualizer, run real code in the playground, work graded lessons, or paste a snippet into the inspector. Nothing you write is uploaded.
1 Choose a language
2 Choose your level
Your learning track
🧰 Bunker tools that pair with this
Runs in an isolated Web Worker, stopped after 3 seconds so an infinite loop cannot freeze the page. Nothing leaves your browser.
Worked Example
Count to 5. for (let i = 1; i <= 5; i++) { console.log("count:", i); } tests i <= 5 six times: true for i = 1, 2, 3, 4 and 5, false at i = 6. The body runs 5 times and prints 5 lines, count: 1 to count: 5. The test always runs once more than the body: the last, false test is what ends the loop.
Recursive factorial. fact(6) calls itself with 5, 4, 3, 2 and 1, which is 6 calls in all. fact(1) hits the base case and returns 1, then the answers unwind: 2 × 1 = 2, 3 × 2 = 6, 4 × 6 = 24, 5 × 24 = 120, 6 × 120 = 720. At the deepest point the call stack holds 7 frames (the global program plus 6 calls of fact).
The common mistake: writing i < 5 for “1 to 5”. The test is now false at i = 5, so the body runs 4 times and prints count: 1 to count: 4: 4 lines instead of 5. This off-by-one error is the most common loop bug; the Output lines readout catches it straight away.
Show Work
How It Works
Background
JavaScript was conceived by Brendan Eich at Netscape and shipped in Netscape Navigator 2.0 in September 1995 (MDN Web Docs, “JavaScript” glossary entry). It is standardised as ECMAScript in Ecma International’s ECMA-262: the 1st edition is dated June 1997, and the 17th edition, ECMAScript 2026, June 2026 (Ecma International, ECMA-262 page). Because every browser runs it, it is the one language this page can run without downloading anything.
Python was created in the early 1990s by Guido van Rossum at Stichting Mathematisch Centrum (CWI) in the Netherlands, as a successor of a language called ABC (Python documentation, “History and License”). The Code Lab’s Python track parses a teaching subset of it into the same interpreter that runs JavaScript, which is why its visualizer and inspector are live while a Python playground is not yet.
Seeing code run. Philip Guo’s paper “Online Python Tutor: Embeddable Web-Based Program Visualization for CS Education” (SIGCSE 2013) describes the best-known step-through visualizer: started in January 2010, used by over 200,000 people by the time of the paper, with a server that runs each program under Python’s debugger, records the state after every executed line, and stops after 300 executed lines. The Code Lab’s visualizer does the same job inside the page with its own interpreter and a 5,000-step limit, so no code is sent anywhere.
The sandbox. Web Workers run a script “in a background thread separate from the main execution thread”, and Worker.terminate() stops a worker at once without letting it finish (MDN Web Docs, Web Workers API and Worker.terminate()). The playground relies on exactly those two properties for its 3-second limit.
About This Tool
The Code Lab is the front door to the site’s programming tools. It holds 18 languages and 4 levels; choosing one of each opens a track that links to the experiences that work for that language today (all 4 for JavaScript, 2 for Python) and marks the rest “Coming soon” rather than sending you to an empty page. The JavaScript playground on this page runs real code and reports what it printed, how long it took and how many steps the visualizer would trace.
Unlike most learn-to-code sites it needs no account and no server: the playground runs in a Web Worker and the visualizer, lessons and inspector use an interpreter that ships with the page. Your code runs in your browser and is never uploaded. Because it sits inside Utilities Bunker, each track also points at the real tools that go with the language, such as a JSON formatter or a regex tester.
It is for people who have never written a line of code, for students who want to watch a loop or a recursive call happen, and for teachers who want a shareable link to a language and level.
Related tools: Regex Tester, JSON Formatter, and Number Base Converter.
Frequently Asked Questions
Does my code get uploaded anywhere?
No. The playground runs your JavaScript in a Web Worker inside this tab, and the visualizer, lessons and inspector use an interpreter that is part of the page. Nothing you type is sent to a server, and there is no account.
Which languages actually work today?
JavaScript has all 4 experiences: playground, Execution Visualizer, graded lessons and Code Inspector. Python has 2: the visualizer and the inspector run a teaching subset of Python (for loops over range(), def, lists, print). The other 16 languages on the grid are planned and say so on their card.
What happens if I write an infinite loop?
The playground stops the worker after 3 seconds with Worker.terminate(), prints a timeout message and counts it as 1 error, so the page never freezes. The visualizer has its own guard: it stops after 5,000 steps.
What do the readouts mean?
Output lines counts what your program printed (FizzBuzz to 15 prints 15). Run time is measured inside the sandbox with performance.now(); the presets take well under 1 ms. Steps traced is how many steps the Execution Visualizer records for the same code, the count you can step through there. Errors counts error messages plus a timeout, so an endless loop shows 1.
I have never written code. Where do I start?
Choose JavaScript and Never Coded, then open Lessons. Lesson 1 asks for one line, console.log("Hello, world!"), and grades it in the page. The Hello, world preset here is the same program: 1 line of code, 1 output line.
How do I use the The Code Lab: Learn to Program?
Just type your numbers. The answer shows up right away — there is no button to press. Change anything and it updates by itself.
Do I need to install or sign up for anything?
Not at all — it runs in the browser with nothing to install and no account. After it loads once, it even works without an internet connection.
Is my information private?
Yes. Everything happens in your browser. Nothing you type is sent to a server or saved anywhere.
Common Use Cases
Try a first program
Run the Hello, world preset: 1 line of code, 1 output line, 0 errors, nothing to install.
Check a loop bound
The Count to 5 preset tests i <= 5 six times and prints 5 lines; change it to i < 5 and only 4 lines print.
See recursion depth
The factorial preset prints 720 for 6! after 6 calls, with the call stack 7 frames deep at its deepest.
Practise an interview classic
FizzBuzz to 15 prints 15 lines with Fizz 4 times, Buzz 2 times and FizzBuzz once; the run log shows each line.
Plan a learning track
Pick a language and 1 of 4 levels and get a shareable link such as ?lang=javascript&level=beginner for a class or a friend.
Last updated: