Coding Typing Test — Type Code in Python, Java, C++, JavaScript and 11 More Languages
This is a free coding typing test, which some people search for as a code typing test or a programming typing test: the same speed test as the home page, opened on its Code text type. Pick a language, type the snippet, and you get net WPM, accuracy and a graph of your speed. It is a code typing test for programmers, students and anyone who wants their brackets, quotes and operators to come out clean.
Below: what the code looks like and what it is not, why symbols slow you down, a short note on each language (a Python typing test, a Java typing test, Kotlin, C++, C#, JavaScript, TypeScript, Go, Rust, Swift, PHP, Ruby, HTML, CSS and SQL), and how to choose a length.
How the coding typing test works
Under the typing box you will see a row of text types, and this page opens on Code. When Code is selected a second row appears with the languages: Any, JavaScript, TypeScript, Python, Java, Kotlin, C++, C#, Go, Rust, Swift, PHP, Ruby, SQL, CSS and HTML. Any mixes only the original five (JavaScript, Python, SQL, CSS and HTML); choose the others by name. The timer starts on your first keystroke, runs for the length you chose (60 seconds to begin with), and net WPM is correct characters divided by five, divided by the minutes. Accuracy and the Backspace rule are the same as everywhere on the site and are written out in the typing speed test guide. You can change the length from 15 seconds to 30 minutes, or enter your own, and the page also works as an online coding typing test for 5 minutes or longer.
What the code looks like, and what it is not
The snippets are generated, not copied from a list: templates have names and numbers filled in, so no two snippets are the same. Each snippet is one line, with statements joined by a space or a semicolon. That means you never press Enter or type indentation, and in Python a block such as a loop appears as one statement on its own line. The test is therefore a drill for symbols and names, not a test of editing real multi-line code in an editor. The samples below were made by the generator itself; every test makes new ones.
| Language | Beginner sample | Advanced sample |
|---|---|---|
| Python | height = 9; print("apple"); size = "river"; note = 1; order = 3 | money = money + 99; squares = [n * n for n in range(5)]; names = [w.upper() for w in ["paper", "quick"]] |
| Java | int city = 9; String name = "garden"; System.out.println(name); city = city + 4; | try { Thread.sleep(100); } catch (InterruptedException e) { e.printStackTrace(); } List<Integer> name = new ArrayList<>(); |
| Kotlin | val cart = "river"; println(cart); var path = 1; path = path + 4; val user = "blue" | val countNote = mapOf("world" to 7, "quick" to 1); val height = if (30 > 11) "typing" else "river"; for (i in 0 until 3) { println(i) } |
| C++ | std::string size = "world"; std::cout << size << std::endl; int name = 5; | auto nameWidth = std::make_unique<int>(51); std::map<std::string, int> scorePrice = {{"apple", 89}, {"blue", 7}}; |
| C# | int color = 3; color = color + 1; string size = "typing"; Console.WriteLine(color); | var name = new List<int> { 33, 24, 27 }; Func<int, int> parseTotal = rate => rate * 6; string count = 72 > 95 ? "hello" : "typing"; |
| JavaScript | let page = 6; const tag = "light"; page = page + 5; console.log(page); | const user = 7 > 37 ? "start" : "apple"; for (let i = 0; i < 15; i++) { console.log(i); } |
| TypeScript | const color: string = "garden"; let step: number = 3; step = step + 8; | enum Money { Garden, Other } async function makeCount(): Promise<void> { const res = await fetch("/api/index"); console.log(res.status); } |
| Go | color := 1; color = color + 3; age := "green"; fmt.Println(color); size := 7 | listNote := map[string]int{"happy": 78, "blue": 83}; for i := 0; i < 17; i++ { fmt.Println(i) }; defer fmt.Println("green") |
| Rust | let mut size = 2; size = size + 5; println!("{}", size); let color = "garden"; | let height: Option<i32> = Some(24); for i in 0..14 { println!("{}", i); } let update_tag = |path: i32| path * 5; |
| Swift | let path = "green"; print(path); var team = 2; team = team + 8; let city = "blue" | let hideUser = { (score: Int) -> Int in score * 1 }; let step = ["garden": 4, "world": 11]; var scoreTeam: Int? = 94 |
| PHP | $price = 9; $price = $price + 8; echo $price; $width = "ready"; echo $width; | try { throw new Exception("world"); } catch (Exception $e) { echo $e->getMessage(); } $note = ["blue" => 3, "quick" => 90]; |
| HTML | <span>Done</span> <b>Green</b> <b>River</b> <p>Blue</p> | <div class="rate"><button type="button" onclick="findResult()">Light</button></div> |
| CSS | body { margin: 0; } .rate { color: black; } p { color: blue; } | .note { margin: 24px; padding: 27px; } .tag:hover > a { background: gray; border-radius: 9px; } |
| SQL | SELECT * FROM teams LIMIT 9; SELECT * FROM items; SELECT result FROM notes; | SELECT rate, SUM(size) FROM items GROUP BY rate ORDER BY rate DESC; |
The level menu changes the code too. Levels 1 and 2 give short statements; levels 3 and 4 add functions, conditions and loops; level 5 adds arrow functions, objects, queries with several parts and more symbols. In Python, Java, Kotlin, C++, C#, Go, Rust and Swift a block, method or struct is a snippet on its own, because it cannot sit between plain statements. Our own tests run the JavaScript and Python snippets through the real parsers and the TypeScript snippets through the TypeScript compiler, so those are valid code. For Java, Kotlin, C++, C#, Go, Rust, Swift, PHP and Ruby we only check that brackets and quotes match; we do not compile them, so they are typing text and not code to copy.
Why symbols slow you down
In prose most of your keystrokes are letters on or near the home row. In code a big share are brackets, braces, quotes, colons, semicolons and operators, which sit at the edges of the keyboard and often need Shift. A wrong one also counts as an error, so a clean run needs accuracy on exactly the keys that are hardest to hit. That is our reasoning and not a measured figure, but it is why we suggest comparing code runs only with other code runs. The keyboard finger chart shows which finger owns each symbol key.
Python typing test
Python has few braces, so the symbols that matter are colons, parentheses, square brackets, quotes, the underscore in names such as step_path and the comparison and arithmetic operators. Names are lowercase with underscores, which keeps Shift use lower than in JavaScript. Choose Python in the language row for a Python typing speed test of statements like list comprehensions and for loops.
JavaScript typing test
JavaScript brings braces, parentheses, semicolons, the arrow => and quotes together, and names are written in camelCase, so you press Shift in the middle of a word (indexLevel, saveCity). It is usually the language with the most Shift presses per line in this test, which is a good reason to take a JavaScript typing speed test on its own and not mixed with the others.
Java typing test
Java ends every statement with a semicolon and wraps blocks in braces, with types written out in full: int, String, and at Advanced List<Integer> and Map<String, Integer>, where the angle brackets need Shift. The long call System.out.println comes up again and again, so a Java typing speed test is partly a drill in typing that one phrase cleanly. Methods such as public static int addTotal(int a, int b) appear as a snippet of their own.
Kotlin typing test
Kotlin needs fewer semicolons than Java and declares with val and var, with the type after a colon: var scoreStep: Int? = 39. Strings can carry a dollar sign, as in println("Total: $total"). Advanced adds listOf, mapOf("a" to 1), lambdas such as { x: Int -> x * 3 }, if used as a value and a data class as a snippet of its own. Statements are joined with ; to keep each snippet on one line.
C++ typing test
C++ snippets lean on the double colon in std::string and std::cout, the stream operator << and std::endl, so Shift and the colon key come up constantly. Advanced adds std::vector<int>, std::map with nested braces, lambdas such as [](int x) { return x * 3; } and std::make_unique. The test leaves out #include lines and the main function, so it is a drill in statements.
C# typing test
C# looks like Java with its own habits: method names start with a capital (Console.WriteLine, FindTeam), foreach (var n in list) loops, List<int> and Dictionary with braces, lambdas with =>, and at Advanced a string with interpolation such as $"Total: {total}", which mixes a dollar sign, quotes and braces.
TypeScript typing test
TypeScript is JavaScript with types, so you type the same braces and arrows plus a colon and a type after each name: let step: number = 3;, number[], Promise<void>. Advanced adds interface, type, enum and generics such as <T>. Our tests run these snippets through the TypeScript compiler, so they are valid TypeScript.
Go typing test
Go declares with :=, which is a colon and an equals sign in a row, and it prints with fmt.Println. Go does not end a statement with a semicolon, so in this test statements are joined with ; only to keep each snippet on one line. Advanced adds []int{...}, map[string]int{...}, func values, defer and a struct as a snippet of its own.
Rust typing test
Rust prints with a macro, println!("{}", x), where the exclamation mark, quotes and braces all need Shift. Names are snake_case, numbers are declared let mut, and ranges are written 0..10. Advanced adds vec![...], closures such as |x: i32| x * 5, Option<i32>, String::from and match.
Swift typing test
Swift declares with let and var, prints with print(...) and writes ranges as 0..<10. Advanced adds closures such as { (x: Int) -> Int in x * 3 }, dictionaries like ["a": 1], optionals with a question mark (Int?), string interpolation with a backslash and parentheses, and a struct as a snippet of its own.
PHP typing test
Every PHP variable starts with a dollar sign ($total), so Shift and the 4 key repeat all through a snippet. You also meet echo, the array arrow =>, foreach ($list as $n), short functions with fn($x) => ... and the object arrow in $e->getMessage(). The snippets have no opening <?php tag.
Ruby typing test
Ruby has no braces around most code and no type names, so a snippet is mostly names, =, quotes and a few symbols. The symbols that do appear are the hash arrow =>, the lambda arrow ->(x) { x * 3 }, blocks like { |n| puts n } with the pipe key, interpolation written #{total}, and :symbol names. Names are snake_case. The one-line forms if ... then ... end and def name(a, b) a + b end are valid Ruby.
HTML typing test
HTML is almost all angle brackets, slashes and quotation marks: every tag opens and closes, and attributes such as href="/page" need quotes. The angle brackets are Shift on the comma and full stop keys, and the closing slash is its own key. An HTML code typing test rewards a steady rhythm for the repeated open-and-close pattern.
CSS typing test
CSS snippets are braces, colons and semicolons repeated again and again, with selectors that start with a full stop or a hash, and values with units such as px and %. At higher levels you meet :hover > a. If the semicolon and colon keys slow you down, a CSS typing test shows it quickly.
SQL typing test
SQL keywords are written in capitals (SELECT, FROM, ORDER BY) while table and column names are lowercase, so you switch case often, and a wrong case counts as an error like any other wrong character. Advanced snippets add SUM(size), GROUP BY and INSERT INTO with quoted values.
Choosing a length for a code test
These are our suggestions, not a tested method. Start with 60 seconds in one language to get a first number. Use 2 or 3 minutes when you want to see whether your accuracy holds as the symbols repeat; the length pages explain how to read a longer run, for example the 3 minute typing test and the 5 minute typing test. Keep the language and the level the same from run to run so the numbers compare.
Speed or accuracy: what matters for programmers
We looked for a study of how fast programmers type and found none, so we do not quote a benchmark. Two field studies of how developers spend their time found that editing code is only about 5% of the day, while reading and understanding code takes most of it. Our post on typing speed for programmers sets out the studies and what we take from them: for most developers, clean typing of symbols matters more than a high WPM score.
Challenge a friend, leaderboard and practice
After a finished code run, Challenge a friend makes a link that rebuilds the same snippet text, length, level and language for your friend and shows your score as the target. If you are logged in, a run of one minute or longer with at least 95% accuracy counts for the leaderboard, where you can filter by text type. To work on the keys you miss, open typing practice and choose the Code tab; it uses the same languages and remembers your choice.
Limits of this test
- The snippets are single lines with no Enter key and no indentation, so this is a symbol and speed drill, not a replica of editing real code.
- The fifteen languages are JavaScript, TypeScript, Python, Java, Kotlin, C++, C#, Go, Rust, Swift, PHP, Ruby, SQL, CSS and HTML. There is no R, Dart, Scala, Bash or others yet, and Any mixes only the original five.
- Java, Kotlin, C++, C#, Go, Rust, Swift, PHP and Ruby snippets are checked only for matching brackets and quotes. They are not compiled and some would not compile as written.
- It is practice. Employer and exam tests set their own text and rules, and the home guide lists the limits that apply to every test.
Coding typing test FAQ
What is a coding typing test?
A typing test where the text is code instead of prose, so the symbols (brackets, quotes, colons, operators) count as much as the letters. Here you choose a language (Python, Java, C++, JavaScript, Kotlin and more), type for the length you pick, and get net WPM, accuracy and a speed graph.
Which programming languages can I choose?
Fifteen: JavaScript, TypeScript, Python, Java, Kotlin, C++, C#, Go, Rust, Swift, PHP, Ruby, SQL, CSS and HTML. Press one in the language row under the typing box. Any mixes only the original five (JavaScript, Python, SQL, CSS and HTML); the other ten appear when you choose them by name.
Is there a free Python typing test?
Yes. Open this page, press Python in the language row under the typing box, and the test fills with Python snippets. It is free, runs in your browser and needs no signup. The same goes for every other language in the row.
Is there a Java, C++ or C# typing test?
Yes. Press Java, C++ or C# in the language row. The snippets are statements such as variable declarations, loops and printing (for example System.out.println in Java, std::cout in C++ and Console.WriteLine in C#). They are typing text: we check that the brackets and quotes match but we do not compile them.
Is the code valid, or just random symbols?
It is built from templates of real statements. Our tests run the JavaScript and Python snippets through the real parsers and the TypeScript snippets through the TypeScript compiler. For Java, Kotlin, C++, C#, Go, Rust, Swift, PHP and Ruby we only check that brackets and quotes match, so a snippet may not compile on its own (Go, for one, refuses to compile a variable that is declared and never used, and our snippets often do that). Treat it as typing practice, not as code to copy.
Do I have to press Enter or type indentation?
No. Every snippet is a single line, with statements joined by a space or a semicolon, so the whole test is typed without the Enter key or leading spaces. That makes this a symbol and name drill, not a test of real multi-line editing.
Is typing code slower than typing normal text?
Usually, because the symbols sit away from the home row and you meet capitals and punctuation constantly. That is our reasoning, not a measured figure, so compare code runs only with other code runs, and the same language and level with each other.
How fast should a programmer type?
There is no benchmark we trust. We looked for a study of programmers' typing speed and found none. Two field studies of how developers spend their day put editing code at only about 5% of the time, so accuracy on symbols matters more than a high WPM score.
Can I practise code typing for free online, not just test it?
Yes. The typing practice page has a Code tab with the same fifteen languages, and your language choice carries over. Practice adapts to the keys you miss, which on code are often the bracket and quote keys.
Sources and method
- Scoring and rules: the same as the typing speed test, where the method is written in full.
- How the code is made: our own code generator, described in the section above; the samples were produced by it.
- Developer time studies: summarised with links in typing speed for programmers.
Written and maintained by Ashiqur Rahman. If the test behaves differently from what is described here, tell me and I will fix the page or the test.