A modern desktop Typing Speed Test application built using Java Swing that measures typing speed, accuracy, mistakes, errors, and overall performance in real time.
The application includes multiple difficulty levels, configurable test durations, live character highlighting, personal-best tracking, persistent typing history, and an analytics dashboard for monitoring improvement over time.
- Real-time typing analysis
- Automatic timer start when typing begins
- Live Net WPM calculation
- Live Gross WPM calculation
- Real-time accuracy calculation
- Error detection
- Mistake tracking
- Corrected mistake tracking
- Current passage progress indicator
Characters in the reference passage are highlighted dynamically:
- ๐ข Green โ correctly typed character
- ๐ด Red โ incorrectly typed character
- ๐ฃ Highlighted โ current character to type
- โช Grey โ characters not typed yet
This gives immediate visual feedback while typing.
The application provides three difficulty modes:
- Easy
- Medium
- Hard
Each difficulty level uses passages appropriate to its complexity.
Users can choose between:
- 15 seconds
- 30 seconds
- 60 seconds
- 120 seconds
The selected duration is used when calculating final typing performance.
If a user finishes the current passage before the timer expires:
- The current passage statistics are recorded.
- A new random passage is generated.
- The typing area is cleared.
- The test continues without resetting the timer.
This allows continuous typing during longer tests.
The application tracks:
| Metric | Description |
|---|---|
| Net WPM | Typing speed based on correctly typed characters |
| Gross WPM | Typing speed based on total typed characters |
| Accuracy | Percentage of correctly typed characters |
| Errors | Incorrect characters currently present |
| Mistakes | Total typing mistakes made |
| Corrected Mistakes | Mistakes corrected using deletion/backspace |
| Characters | Total characters typed |
| Passages | Number of completed passages |
The application includes a dedicated analytics screen for tracking typing performance over time.
The dashboard displays:
- Total tests completed
- Average WPM
- Best WPM
- Average accuracy
- Recent typing attempts
- WPM progress graph
The graph displays recent test results and makes it easier to observe typing-speed improvement.
The application stores personal records including:
- Best Net WPM
- Best Accuracy
- Total Tests Completed
Personal best statistics are stored using the Java Preferences API.
Records are maintained separately for different test durations.
Completed typing tests are stored locally so previous results can be viewed later.
Each test result contains information such as:
- Date and time
- Difficulty
- Test duration
- Net WPM
- Gross WPM
- Accuracy
- Mistakes
- Corrected mistakes
- Errors
- Characters typed
- Completed passages
The application can also clear stored typing history directly from the Analytics screen.
A standard typing word is considered to contain approximately 5 characters.
Gross WPM = (Total Characters Typed / 5) / Time in Minutes
This project calculates Net WPM using correctly typed characters:
Net WPM = (Correct Characters / 5) / Time in Minutes
Accuracy = (Correct Characters / Total Characters Typed) ร 100
- Java
- Java Swing
- Java AWT
- Swing Timer
- StyledDocument
- DocumentListener
- DocumentFilter
- Java Preferences API
- File handling
- CSV-based local history storage
- Git
- GitHub
TypingSpeedTest/
โ
โโโ TypingSpeedTest.java
โโโ TypingCalculator.java
โโโ PassageManager.java
โโโ TestResult.java
โโโ HistoryManager.java
โโโ .gitignore
โโโ README.md
Main application class responsible for:
- Graphical user interface
- Typing test logic
- Timer
- Navigation
- Live statistics
- Passage highlighting
- Result screen
- Analytics dashboard
- Keyboard shortcuts
- Personal-best management
Handles typing-related calculations such as:
- Correct character counting
- Error counting
- Accuracy
- Gross WPM
- Net WPM
- Progress percentage
- Performance ratings
Responsible for:
- Managing typing passages
- Difficulty-based passages
- Random passage selection
- Word counting
Represents an individual typing-test result and stores its associated statistics.
Handles persistent typing history, including:
- Saving test results
- Loading previous results
- Clearing history
- Local CSV data management
Make sure the Java Development Kit (JDK) is installed.
Check your Java installation:
java -versionCheck the Java compiler:
javac -versiongit clone https://github.com/vanshantil/Typing-Speed-Test-Java.gitcd Typing-Speed-Test-Javajavac *.javajava TypingSpeedTestThe Typing Speed Test window should now open.
| Shortcut | Action |
|---|---|
Ctrl/Cmd + R |
Restart current test |
Ctrl/Cmd + N |
Start a new test |
The shortcuts work on both Windows/Linux and macOS using the operating system's standard menu shortcut key.
Launch Application
โ
Select Difficulty
โ
Select Test Duration
โ
Start Typing
โ
Timer Starts Automatically
โ
Real-Time Statistics Update
โ
Passage Completed?
โ โ
Yes No
โ โ
Load New Continue
Passage Typing
โ โ
Timer Ends
โ
Calculate Results
โ
Save History
โ
Update Personal Records
โ
Results Screen
โ
Analytics Dashboard
The application uses a custom dark interface built entirely with Java Swing.
The interface includes:
- Dark themed dashboard
- Statistic cards
- Styled buttons
- Hover effects
- Progress bars
- Dynamic text highlighting
- Results dashboard
- Analytics tables
- Custom WPM graph
This project demonstrates several important Java and Object-Oriented Programming concepts:
- Classes and objects
- Encapsulation
- Object-oriented design
- Event-driven programming
- Inner classes
- Inheritance
- Method overriding
- Java Collections
- Exception handling
- File handling
- GUI development
- Swing components
- Event listeners
- Document listeners
- Document filters
- Java Preferences API
- Custom painting with
Graphics2D
Runtime and compiled files are intentionally excluded from Git using .gitignore.
Examples include:
*.class
typing_history.csv
.DS_Store
.vscode/
.idea/
This keeps the repository clean and ensures only source code and project documentation are version controlled.
Possible future additions include:
- User accounts and profiles
- More typing passages
- Custom passage mode
- Words-only typing mode
- Punctuation mode
- Numbers mode
- Accuracy graph
- Mistakes heatmap
- Typing consistency measurement
- WPM comparison between difficulty levels
- Daily typing goals
- Typing streak tracking
- Exportable performance reports
- Database-based history
- Online leaderboard
- Sound effects
- Additional themes
- Light mode
- Packaging as an executable JAR
Building this project provides practical experience with:
- Java application development
- Object-Oriented Programming
- Desktop GUI development
- Event-driven programming
- Data persistence
- Real-time calculations
- Custom Swing rendering
- File management
- Application state management
- Git version control
- GitHub project management
B.Tech Computer Science Engineering
AI & Data Science
If you find this project useful, consider giving the repository a star โญ.
Contributions, suggestions, and improvements are welcome.