A modern, feature-rich stopwatch with beautiful UI, dark mode support, and advanced functionality. Built with vanilla JavaScript, HTML, and CSS.
Time is precious, and tracking it precisely is essential.
This Stopwatch displays time in HH:MM:SS:MS (hour:minute:second:millisecond) format.
It includes Pomodoro timers, custom countdown timers, and persistent dark/light mode.
- HTML5 - Semantic markup
- CSS3 - Modern styling with glassmorphism & animations
- JavaScript (ES6+) - Vanilla JS for optimal performance
- Bootstrap 5 - Responsive grid system
- Font Awesome - Beautiful icons
- Audio - Start, pause, reset, lap sounds
- β²οΈ Precise Time Display: HH:MM:SS:MS
βΆοΈ Start / Pause: Smooth toggle- π Reset: Clear time and laps
- π Lap Timer: Record multiple laps
- ποΈ Clear Laps
- π Seamless theme switching
- πΎ Persistent Preference saved automatically
- π Glassmorphism UI for a modern look
- πΏ Auto-save stopwatch state
- π Resume on reload (up to 24 hours)
- π― Smart Recovery restores recent sessions
- π Optional ticking sound
- π΅ Audio feedback for start, pause, reset, laps
- β¨οΈ Keyboard Shortcuts:
- Space β Start/Pause
- R β Reset
- L / Enter β Record Lap
- Backspace β Reset
- P β Start/Pause (alternative)
- Numpad 0 β Clear Laps
- π Pomodoro Timer
- β²οΈ Custom Countdown Timer
- π± Mobile & tablet optimized
- π» Desktop ready with adaptive layout
- π¨ Touch-friendly buttons
- π Rounded buttons with smooth animations
- πΌοΈ Optional lofi video background
# Clone the repository
git clone https://github.com/avinash201199/stopwatch.git
cd stopwatch
# Open index.html in browser
# Or run a local server
python -m http.server 8000
# Then visit http://localhost:8000
## π Quick Start
### Option 1: Visit the Live Site
Simply visit [https://avinash201199.github.io/stopwatch/](https://avinash201199.github.io/stopwatch/) to use the stopwatch immediately!
### Option 2: Run Locally
1. **Clone the repository**
```bash
git clone https://github.com/avinash201199/stopwatch.git
cd stopwatch-
Open in browser
# Simply open index.html in your browser # Or use a local server: python -m http.server 8000 # Then visit http://localhost:8000
-
Start using!
- Click Start or press Space to begin
- Press L to record laps
- Press R to reset
- Toggle dark mode with the switch in the navbar
- Start/Pause: Click the Start button or press
Space - Reset: Click Reset or press
Rto clear everything - Record Lap: Click Lap or press
Lwhile running - Clear Laps: Click Clear Lap to remove all lap records
- Dark Mode: Toggle the switch in the top-right corner
| Key | Action |
|---|---|
Space |
Start/Pause |
R |
Reset |
L |
Record Lap |
E |
Export Laps |
Ctrl+β |
Next Video (NEW!) |
Ctrl+β |
Previous Video (NEW!) |
Ctrl+1-4 |
Jump to Video 1-4 (NEW!) |
Ctrl+V |
Toggle Auto-Rotation (NEW!) |
Enter |
Record Lap |
Backspace |
Reset |
P |
Start/Pause |
Numpad 0 |
Clear Laps |
Interface of the StopWatch
StopWatch Started
Dark-Mode On
Pomodoro Timer
Custom Timer
We welcome contributions! Please follow these guidelines:
- Star this repository by pressing the top-rightmost button to start your incredible journey.
- Create an issue describing how you want to contribute to this project.
-
Then fork this repository by using the Fork button on top-right of your screen.
-
In the forked repository add your changes.
NOTE: commands are to be executed on Linux, Mac, and Windows(using Powershell)
- You need to clone (download) it to a local machine using
$ git clone https://github.com/Your_Username/stopwatch.gitThis makes a local copy of the repository in your machine.
- Then make a pull request with the issue number.
- Once you have cloned the stopwatch repository in Github, move to that folder first using the change directory command on Linux, Mac, and Windows(PowerShell to be used).
# This will change the directory to a folder stopwatch
$ cd stopwatchMove to this folder for all other commands.
- Run the following commands to see that your local copy has a reference to your forked remote repository in Github

$ git remote -v
origin https://github.com/Your_Username/stopwatch.git (fetch)
origin https://github.com/Your_Username/stopwatch.git (push)Now, let's add a reference to the original stopwatch repository using
$ git remote add upstream https://github.com/avinash201199/stopwatch.gitThis adds a new remote named upstream.
See the changes using
$ git remote -v
origin https://github.com/Your_Username/stopwatch.git (fetch)
origin https://github.com/Your_Username/stopwatch.git (push)
upstream https://github.com/Remote_Username/stopwatch.git (fetch)
upstream https://github.com/Remote_Username/stopwatch.git (push)In your case, you will see
$ git remote -V
origin https://github.com/Your_Username/stopwatch.git (fetch)
origin https://github.com/Your_Username/stopwatch.git(push)
upstream https://github.com/ietebitmesra/stopwatch.git (fetch)
upstream https://github.com/ietebitmesra/stopwatch.git (push)- Always keep your local copy of the repository updated with the original repository. Before making any changes and/or in an appropriate interval, run the following commands carefully to update your local repository.
# Fetch all remote repositories and delete any deleted remote branches ``
$ git fetch --all --prune# Switch to `master` branch
$ git checkout master# Reset local `master` branch to match the `upstream` repository's `master` branch
$ git reset --hard upstream/master# Push changes to your forked `stopwatch` repo
$ git push origin master- Once you have completed these steps, you are ready to start contributing by checking our Help Wanted Issues and creating pull requests.
- Whenever you are going to contribute. Please create a separate branch using command and keep your master branch clean (i.e. synced with remote branch).
# It will create a new branch with name Branch_Name and switch to branch Folder_Name
$ git checkout -b BranchName- Create a separate branch for contribution and try to use the same name of the branch as of folder.
To switch to the desired branch
# To switch from one folder to other
$ git checkout BranchName
To add the changes to the branch. Use# To add all files to branch Folder_Name
$ git add .
Type in a message relevant for the code reviewer using# This message gets associated with all files you have changed
$ git commit -m 'relevant message'Now, Push your awesome work to your remote repository using
# To push your work to your remote repository
$ git push -u origin BranchName- Finally, go to your repository in the browser and click on compare and pull requests. Then add a title and description to your pull request that explains your precious efforts
stopwatch/
βββ index.html # Main stopwatch page
βββ script.js # Core stopwatch logic with localStorage
βββ style.css # Styling with glassmorphism effects
βββ audio/ # Sound effects
β βββ beep_cut.mp3
β βββ sound_trim.mp3
β βββ ticking.mp3
βββ img/ # Images and screenshots
βββ pomodoro/ # Pomodoro timer feature
βββ custom_timer/ # Custom countdown timer
βββ README.md # This file
- β Enhanced Voice Control - Hands-free operation with natural language commands
- β Lap Export Functionality - Export lap times to CSV with timestamps
- β Local Storage Support - Never lose your progress on reload
- β Enhanced Sound Effects - Start, pause, reset, and lap sounds
- β Improved Keyboard Shortcuts - Space, R, L, E for quick actions
- β Code Cleanup - Better organization and comments
- β Modern UI Updates - Enhanced glassmorphism and animations
- β Persistent Dark Mode - Your theme preference is saved
- β Updated Documentation - Comprehensive README with usage guide
- Quick Start: Press
Spaceto instantly start the stopwatch - Rapid Laps: Use
Lkey for quick lap recording during activities - Theme Preference: Your dark/light mode choice persists across sessions
- Auto-Save: The stopwatch automatically saves your progress every second
- Keyboard Master: Learn the shortcuts for a seamless experience
- Video background may not load on slower connections (graceful fallback)
- Audio may require user interaction on some browsers due to autoplay policies
- LocalStorage limited to 24-hour persistence (by design)
This project is licensed under the MIT License - see the LICENSE file for details.
- Original Creator: Avinash Singh β for building the foundation of this stopwatch project
- Enhancements & Contributions: Hector JS and the amazing open-source community
- Icons & Graphics: Font Awesome β for the crisp and professional icons
- Fonts: Google Fonts β for the modern typography
- Background Animation: Lofi video animation β for the relaxing, aesthetic UI
- Special Thanks: To all contributors who help improve this project and make it Hacktoberfest-ready! π
Thank you to all the amazing contributors who have helped make this project better! π
β If you like this project, please give it a star! β
Made with β€οΈ by the open-source community





