TypeScript Typing Test
Type real TypeScript: type annotations, generics, interfaces and union types.
Loading coding passages...
TypeScript is JavaScript with a second layer of punctuation: a colon before every type, angle brackets around generics, pipes between union members. This test serves real typed code, so you can find out whether the types, not the logic, are what slows you down.
What you will actually be typing
Two excerpts from the 10 TypeScript passages in this test, shown exactly as you type them. Press Enter at the end of each line and the next line’s indentation is filled in for you. Each passage runs to several thousand characters, more than anyone types in five minutes.
type ProfileStatus = 'verified' | 'draft' | 'archived';
type ProfileRecord = { id: number; owner: string; status: ProfileStatus; completion: number; score: number; };
function parseProfile(line: string): ProfileRecord {
const [id, owner, status, metric, value] = line.split('|');
return { id: Number(id), owner, status: status as ProfileStatus, completion: Number(metric), score: Number(value) };
}
function ensureProfileStatus(status: string): asserts status is 'verified' | 'draft' {
if (!['verified', 'draft'].includes(status)) throw new Error('Bad status');
}
type ProfileGroup1<T> = Record<string, T[]>;
function groupProfileByOwner1<T extends { owner: string }>(rows: T[]): ProfileGroup1<T> {
return rows.reduce((groups, row) => {type BookingJob = { id: number; attempts: number; payload: unknown };
async function drainBookingQueue(jobs: BookingJob[], run: (job: BookingJob) => Promise<void>): Promise<number> {
let completed = 0;
for (const job of jobs) { await run(job); completed += 1; }
return completed;
}
function ensureBookingStatus(status: string): asserts status is 'confirmed' | 'requested' {
if (!['confirmed', 'requested'].includes(status)) throw new Error('Bad status');
}
type BookingScoreBlock4<T extends { amount: number }> = { rows: T[]; offset: 1 };Who this test is for
Developers moving from JavaScript to TypeScript who notice their speed fall the moment they start annotating, and TypeScript users who want generic signatures like Record<string, number> to come out in one go.
If plain JavaScript symbols are still a problem, the JavaScript typing test is the easier place to start; this page adds the type syntax on top.
| Durations | 1, 2, 3 or 5 minutes |
|---|---|
| Passages | 10 TypeScript passages, 46,809 characters in all; choose one before you start |
| Difficulty | One level: every passage is real working code, not graded drills |
| What counts | Every character and line break must match the passage. Enter fills in the next line’s indentation; Tab inserts two spaces |
| Speed | Gross WPM = characters typed ÷ 5 ÷ minutes. Net WPM takes one word off per error |
| Accuracy | Overall accuracy, plus symbol accuracy: the share of brackets, quotes and operators typed correctly |
| Report card | Separate counts for symbol, bracket, quote, semicolon, whitespace and new-line mistakes |
The TypeScript symbol profile
Across 10 passages and 46,809 characters, TypeScript here runs at 16.1 symbols per 100 characters, close to JavaScript. What changes is which symbols: colons lead instead of parentheses.
Names average 6.5 characters, slightly longer than JavaScript’s, because type names are PascalCase and descriptive. 4% of characters are capitals, more than in JavaScript, almost all from type names.
| Symbol | Per 100 characters |
|---|---|
| : colon | 1.7 |
| ( parenthesis | 1.4 |
| ) parenthesis | 1.4 |
| ' single quote | 1.3 |
| ; semicolon | 1.3 |
| { brace | 1.1 |
| } brace | 1.1 |
| > angle | 1.1 |
The symbol runs you will type most
Strings inside lists (',) and arrow functions (=>) lead, as in JavaScript. The TypeScript-only runs are }>( and [])::, where a generic constraint or array type closes straight into a parameter list or an annotation.
| Run | Per 1,000 characters |
|---|---|
', | 3.6 |
=> | 3.4 |
); | 2.5 |
}>( | 2.4 |
(( | 1.7 |
[]): | 1.6 |
How TypeScript compares with the other coding tests
| Measure | HTML & CSS | Java | JavaScript | Python | SQL | TypeScript |
|---|---|---|---|---|---|---|
| Symbols per 100 characters | 17.2 | 13.7 | 16.9 | 14.3 | 6.5 | 16.1 |
| Indentation, share of characters | 2.6% | 3.3% | 3% | 8.2% | 0.1% | 1.6% |
| Capital letters, share of characters | 2% | 4.4% | 2.4% | 0.5% | 22% | 4% |
| Average name length | 5.5 chars | 6.9 chars | 6.2 chars | 5.8 chars | 6.3 chars | 6.5 chars |
| Average line length | 37 chars | 39.1 chars | 36.6 chars | 40.3 chars | 32.6 chars | 53.4 chars |
Typing TypeScript: colons, angle brackets and pipes
The colon is the most frequent symbol in these passages, ahead of parentheses, because every annotated parameter and property carries one: id: number, status: Status. Type the colon and the space after it as a single unit, then the type name.
Generics are the hardest stretch. The TypeScript handbook introduces them with a function like identity<Type>(arg: Type): Type, and these passages contain 305 angle-bracket type arguments. < and > are Shift plus comma and period, both under the right hand, so a generic is a short burst of right-hand Shift work. Slow down there rather than everywhere.
Semicolons appear in 59.6% of lines, more than in the JavaScript passages, because type and interface members end with them too. Union types add the pipe, Shift plus backslash, at the far right of the keyboard under the little finger.
Optional properties add a question mark before the colon (owner?: string). It is easy to type the colon first by habit. Read the property name and its two symbols as one unit.
Anatomy of one line
A generic function signature. It opens a type parameter with a constraint inside braces, annotates the parameter and the return type, and uses four kinds of bracket before the body begins.
function groupProfileByOwner1<T extends { owner: string }>(rows: T[]): ProfileGroup1<T> {| Characters | 89 |
|---|---|
| Letters | 64 |
| Symbols | 14 |
| Spaces | 9 |
| Keys that need Shift | 20 |
Reading your TypeScript report card
Bracket errors are the number to watch, and in TypeScript they include the angle brackets of generics as well as braces and parentheses. A missing > in a nested type is the single most common TypeScript-specific slip. Next, look at overall symbol accuracy: colons and pipes are counted there.
Semicolon errors matter more than in JavaScript, because type aliases and interface members end with them as well as statements. If your semicolon count is high but your JavaScript runs are clean, the extra type syntax is the cause.
Mistakes the report card will show most
- A colon typed before the question mark in an optional property.
- A missing closing > in nested generics such as Record<string, Array<number>>.
- Typing a slash or backslash where a union pipe belongs.
- Forgetting the semicolon after an interface member.
The habits that apply to every kind of typing, such as accuracy before speed and short daily practice, are in how to type faster. For symbols on their own, use the symbol typing test.
A three-step practice plan
The aims below are our suggestions, not pass marks. The test itself has no pass mark; it reports your speed and accuracy and lets you judge the trend.
| Step | Run | Aim for |
|---|---|---|
| Warm up | 1 minute on the JavaScript typing test | Clean braces, quotes and arrows first |
| Build | 2-minute TypeScript runs, rotating passages | No missing > in generic types |
| Stretch | 5-minute TypeScript runs | Symbol accuracy of 95% or more |
Frequently asked questions
How is TypeScript typing different from JavaScript typing?
The logic reads much the same, but the punctuation roughly doubles in places: annotations add colons, generics add angle brackets, unions add pipes, and optional fields add question marks. In these passages the colon becomes the most frequent symbol.
Does the report card track TypeScript symbols?
Yes. It reports overall accuracy and symbol accuracy, and lists bracket, quote, semicolon, whitespace and new-line mistakes, so you can see which part of the type syntax is costing you.
Should I practise JavaScript first?
If braces, quotes and arrows still trip you up, yes. TypeScript adds to those rather than replacing them, so a clean JavaScript run is a good foundation.
How many TypeScript passages are there?
10, covering typed records, interfaces, generic helpers, union types and async service code. You can choose a passage and a duration of 1, 2, 3 or 5 minutes before you start.
Do the passages use advanced types?
Some do: generic constraints with extends, Record and union types, type assertions and asserts functions appear alongside plain interfaces and annotated functions.
Why is the colon the most common symbol here?
Because annotations put one before every type: on parameters, return values, properties and variables. In plain JavaScript the same code would have far fewer.
Will this help me read TypeScript faster too?
Indirectly. Typing a construct repeatedly makes its shape familiar, so generic signatures and union types become quicker to recognise as well as to type. The test measures typing, though, not comprehension.
Other coding typing tests
Sources
Conventions cited on this page come from the sources below. Every figure about the passages is measured from the passages themselves, and recalculated each time the site is built.
- GenericsTypeScript Handbook (Microsoft) · link checked 20 Oct 2026