Code typing test

Type real code instead of words: brackets, quotes, operators and all.

Code is slower to type than prose. A line like if items[mid] < target: has square brackets, a comparison and a colon, and in other languages you would add braces, semicolons and a pair of quotes. Most of those keys sit at the edges of the keyboard, where the little fingers do the work, and many need Shift. Expect a lower speed than on common words; this test shows by how much, and which keys cost the most.

Choose a language: Python, JavaScript, Java, C++, SQL or HTML. You can switch under the test at any time, next to “Code” in the list of what to type.

What you type

Each test is made of short pieces of everyday code written for this site: a binary search and a word count in Python, a debounce function and a fetch call in JavaScript, a record and a switch expression in Java, a template and a lambda in C++, joins and a common table expression in SQL, and forms and tables in HTML. The pieces follow each other until the time runs out. You type each piece token by token, with a single space between tokens; line breaks and indentation are left out, as on most code typing tests, because your editor handles those for you anyway.

What to look at afterwards

The results page works the same as for words, and on code it is more revealing. The slowest keys are usually the symbols: brackets, quotes, the underscore and the equals sign. On a US keyboard most of them fall to the right little finger, which also has Enter and Backspace, so the finger chart often shows it as the slowest. The letter pairs show where you hesitate between a name and its bracket. If symbols are the problem, the later touch typing lessons teach every symbol key one at a time, and the punctuation and numbers tests mix them into ordinary words.

Code tests keep their own history for each language and do not go on the leaderboards, so your Python speed is only ever compared with itself.

Questions

Why are line breaks and indents left out?

Every code typing test has to decide what Enter and Tab do. Here each piece is typed as tokens separated by spaces, so the score measures the characters you type, not your editor’s auto-indent.

Is it real code?

Yes: short, working pieces of everyday code in each language, written for this site.

Do code tests go on the leaderboards?

No. They keep their own history for each language, so you can compare your speed in one language with itself over time.