Cambridge IGCSE Pseudocode Editor & Runner
Write Cambridge IGCSE pseudocode, run it right in your browser, and step through every line while you watch the variables change.
What is pseudocode?
Pseudocode is a plain-language way of writing out the logic of a program before you write real code. It uses structured keywords — IF, FOR, WHILE, PROCEDURE — so the steps are unambiguous, but it drops the fiddly syntax of a specific programming language. That makes it perfect for planning algorithms, studying for exams, and explaining ideas.
This editor follows the pseudocode conventions from the Cambridge International syllabuses — IGCSE Computer Science (0478) and A-Level Computer Science (9618): DECLARE with explicit types, the ← assignment arrow, OUTPUT and INPUT, IF/ELSE/ENDIF, CASE OF, FOR…NEXT, WHILE…ENDWHILE, REPEAT…UNTIL, 1-based arrays, and PROCEDURE/FUNCTION with RETURNS. Press Run to see the output, then step through one line at a time.
Cambridge pseudocode syntax at a glance
| Construct | Syntax | Example |
|---|---|---|
| Declare a variable | DECLARE x : TYPE | DECLARE total : INTEGER |
| Assignment | x ← value | total ← 0 |
| Output | OUTPUT expr, expr | OUTPUT "Total: ", total |
| Input | INPUT variable | INPUT name |
| Selection (if / else) | IF … THEN … ELSE … ENDIF | IF n > 5 THEN … ENDIF |
| Multi-way selection | CASE OF x … OTHERWISE … ENDCASE | CASE OF grade 'A' : … ENDCASE |
| Count-controlled loop | FOR i ← a TO b [STEP s] … NEXT i | FOR i ← 1 TO 10 … NEXT i |
| Pre-condition loop | WHILE cond DO … ENDWHILE | WHILE n > 0 DO … ENDWHILE |
| Post-condition loop | REPEAT … UNTIL cond | REPEAT … UNTIL n = 0 |
| Procedure / subroutine | PROCEDURE name(params) … ENDPROCEDURE | CALL greet("Ada") |
| Function that returns a value | FUNCTION name(params) RETURNS TYPE … ENDFUNCTION | RETURN n * n |
| Comment | // comment | // swap the values |
See these algorithms animated
Pseudocode FAQ
What is pseudocode?
Pseudocode is a plain-language way of describing the steps of an algorithm, using structured keywords like IF, FOR and WHILE without the strict syntax of a real programming language. It lets you plan and communicate logic before writing code.
Can you actually run pseudocode?
Pseudocode is not normally executable, but this editor runs a well-defined dialect (Cambridge IGCSE / A-Level pseudocode) entirely in your browser so you can see the output and step through it line by line.
Which pseudocode does this editor use?
It follows the Cambridge IGCSE and A-Level pseudocode conventions — DECLARE, the ← assignment arrow, OUTPUT, INPUT, IF/ELSE/ENDIF, FOR/NEXT, WHILE/ENDWHILE, REPEAT/UNTIL, arrays, and PROCEDURE/FUNCTION.
Is the pseudocode editor free?
Yes. The pseudocode editor and runner are completely free, run in your browser, and need no sign-up or installation.