Typing Speed Test
This is a browser-based typing speed test application that allows users to practice and improve their typing speed. The project dynamically loads random paragraphs, tracks user input, calculates WPM (Words Per Minute) and CPM (Characters Per Minute), and displays mistakes in real-time.
- Random paragraph loading each time
- Real-time WPM calculation
- Real-time CPM calculation
- Mistake counter
- Timer-based typing test
- Active character highlighting
- Input auto-focus when typing or clicking
- HTML5 for structure
- CSS3 for UI styling
- JavaScript (Vanilla) for logic and functionality
/typing-test
├── index.html
├── style.css
└── script.js
- When the page loads, a random paragraph is selected and displayed.
- The user starts typing, and the timer begins automatically on the first keystroke.
- Each character is validated as correct or incorrect.
- Mistakes are counted and highlighted.
- WPM & CPM are calculated dynamically.
- When time runs out, the typing test stops.
| Variable | Description |
|---|---|
timeLeft |
The remaining time of the test |
charIndex |
Current typed character index |
mistake |
Total mistakes made |
isTyping |
Ensures timer starts only once |
- WPM = ((Correct Characters / 5) / Time Spent) × 60
- CPM = Correct Characters per minute
- Add reset/retry button
- Add accuracy percentage
- Add user score history
- Add leaderboard
- Mobile responsive improvements
- Open
index.htmlin your browser. - Start typing immediately when paragraph appears.
- Test ends when the timer reaches zero.
Developed by Ansh Kumar
This project is open-source and can be modified or improved freely.