Did you know you can make your own countdown timer using only Notepad?
No extra software, no coding knowledge required — just a few lines of text and you’ll have a working timer that counts down seconds right on your screen.
In this step-by-step guide, we’ll explain how a countdown timer works, how to create it in Notepad, and different ways to customize it.
What Is a Countdown Timer Script?
A countdown timer script is a small program that starts from a number (like 10 or 60) and decreases by one every second until it reaches zero.
Once the countdown ends, you can make the script show a message, play a sound, or even perform another task such as shutting down your PC.
We’ll use Notepad to write this script because Notepad can create batch (.bat) or VBScript (.vbs) files — both can run directly in Windows.
Why Create a Countdown Timer in Notepad?
There are many apps and websites for timers, but creating your own has some benefits:
✅ You learn basic scripting and automation.
✅ You can customize how it looks and works.
✅ You can combine it with other commands (like launching apps).
✅ It’s lightweight — only a few KBs in size.
✅ Works offline on any Windows computer.
Method 1: Create a Countdown Timer Using Batch File
This is the simplest and most popular method.
Step 1: Open Notepad
Click Start → Notepad or press Windows + R, type notepad
, and hit Enter.
Step 2: Write the Script
Copy and paste the following code:
@echo off
title Countdown Timer
set /p time=Enter countdown time in seconds:
:loop
cls
echo Time remaining: %time% seconds
set /a time=%time%-1
ping localhost -n 2 >nul
if %time% LEQ 0 goto end
goto loop
:end
echo Time's up!
pause
Step 3: Save the File as .bat
- Click File → Save As
- File name:
countdown_timer.bat
- Save as type: All Files
- Encoding: ANSI or UTF-8
- Click Save
Step 4: Run the Timer
Double-click countdown_timer.bat
.
It will ask you to enter the countdown time (e.g., 10 seconds).
After pressing Enter, the timer starts counting down in the Command Prompt window.
How It Works
Let’s break down the code so you understand what’s happening:
@echo off
→ Hides unnecessary command output.title Countdown Timer
→ Sets a custom window title.set /p time=
→ Lets the user input the countdown time.cls
→ Clears the screen each second for a clean display.set /a time=%time%-1
→ Subtracts 1 from the timer value.ping localhost -n 2 >nul
→ Creates a 1-second delay (ping trick).if %time% LEQ 0
→ Checks when the timer reaches 0.goto loop
→ Repeats until done.
Once the timer hits zero, the message “Time’s up!” appears.
Method 2: Countdown Timer with Sound (VBScript)
If you want a cleaner pop-up version instead of Command Prompt, you can use VBScript (.vbs).
Step 1: Open Notepad
Same as before — open a fresh Notepad window.
Step 2: Paste This Code
Dim seconds
seconds = InputBox("Enter countdown time in seconds:")
Do While seconds > 0
WScript.Sleep 1000
seconds = seconds - 1
WScript.Echo "Time remaining: " & seconds & " seconds"
Loop
MsgBox "Time's up!", 64, "Countdown Complete"
Step 3: Save as .vbs
- File → Save As
- File name:
timer.vbs
- Save as type: All Files
- Encoding: ANSI
- Click Save
Step 4: Run It
Double-click the saved file — a pop-up will ask for the number of seconds.
When you press OK, small message windows will appear showing time left.
Finally, a dialog box appears saying “Time’s up!”.
This version looks more user-friendly and runs quietly without the black console window.
Add a Sound Alert
You can make your timer play a sound when finished.
Add this line at the end of your VBScript code before the MsgBox
:
CreateObject("SAPI.SpVoice").Speak "Time is up"
This uses Windows’ built-in speech engine to say “Time is up.”
You can change the message to anything, like “Break over!” or “Task completed!”
Method 3: Countdown with Minutes and Seconds
Want a slightly smarter timer that shows both minutes and seconds?
@echo off
title Countdown Timer (MM:SS)
set /p seconds=Enter total seconds:
:loop
cls
set /a min=%seconds%/60
set /a sec=%seconds%%%60
if %sec% lss 10 set sec=0%sec%
echo Time Remaining: %min%:%sec%
set /a seconds=%seconds%-1
ping localhost -n 2 >nul
if %seconds% leq 0 goto end
goto loop
:end
echo Time's up!
pause
Now you’ll see output like “Time Remaining: 01:09” instead of a single number.
Customizing Your Countdown Timer
Once your script works, you can personalize it easily.
🎨 Change the Colors
Add this line near the top of your batch script:
color 0a
0
= background color (black)a
= text color (green)
Try different combinations like color 1f
, color 2e
, etc.
Add Automatic Actions
After the countdown ends, you can make your computer:
1. Play a beep sound
echo ^G
(Type Ctrl + G for the bell symbol)
2. Open a website
start https://notepadz.online
3. Shut down your PC after the countdown
shutdown /s /t 0
Use these carefully — test before using in real situations.
Tips for Beginners
✅ Always save your file with the correct extension (.bat
or .vbs
).
✅ Use pause at the end of your script to keep the window open.
✅ If your timer closes too quickly, add a pause
line or MsgBox
.
✅ Keep your scripts in a separate folder like C:\Scripts
for organization.
Troubleshooting
Problem | Reason | Fix |
---|---|---|
Window closes instantly | No pause or MsgBox command | Add one at the end |
Command not found | Typo in code | Re-check spelling |
Timer runs too fast | Wrong delay value | Use ping localhost -n 2 >nul |
File doesn’t run | Saved as .txt | Save as .bat or .vbs and select All Files |
Real-Life Uses of Countdown Timers
- ⏰ Remind yourself to take a break while working.
- ⏳ Create study sessions (like Pomodoro technique).
- 🔋 Time how long a process takes.
- 💻 Use before shutting down your PC or closing apps.
You can even combine this timer script with a batch shutdown command to automatically power off your PC after a set time.
Final Thought
Creating a countdown timer in Notepad is a fun and educational way to learn about basic Windows scripting.
It’s easy to understand, requires no installation, and helps you get familiar with simple automation logic.
Whether you need a timer for breaks, studying, cooking, or coding — you can build one in minutes.
Experiment with the design, sounds, and features until it fits your needs.
So next time you need a quick timer, skip Google — just open Notepad and make your own!