Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Keep Notepad Always on Top in Windows

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Yes, you can make Notepad stay always on top of other windows in Windows, but there is no built-in toggle for it. The easiest method is to use a free third-party utility like DeskPins or AutoHotkey, which adds a pin button or a keyboard shortcut to force any window, including Notepad, to stay on top. This guide covers both methods, plus a quick PowerShell trick for advanced users. No admin rights are needed for the tools mentioned.

What You'll Need

  • Windows 10 or Windows 11 (any edition)
  • An internet connection to download a small utility (DeskPins or AutoHotkey)
  • Notepad (the classic app that comes with Windows, or Notepad from the Microsoft Store)

Step-by-Step

Method 1: Using DeskPins (Simplest)

  1. Open your web browser and go to the official DeskPins download page (search "DeskPins official site" or use a trusted mirror like MajorGeeks).
  2. Download the latest version (it's a small .zip file, usually under 1 MB).
  3. Extract the zip file to a folder on your desktop or in your Documents folder. You don't need to install it; the executable runs directly.
  4. Double-click DeskPins.exe to launch it. You'll see a small pin icon appear in your system tray (bottom-right corner, near the clock).
  5. Open Notepad and type or paste whatever you need.
  6. Click the pin icon in the system tray. Your cursor will change to a pushpin.
  7. Click on the title bar of the Notepad window. A red pin will appear on the title bar, and Notepad will now stay on top of all other windows.
  8. To unpin, click the red pin again. The pin icon disappears and Notepad returns to normal behavior.

Method 2: Using AutoHotkey (Keyboard Shortcut)

  1. Go to the official AutoHotkey website (autohotkey.com) and download the installer.
  2. Run the installer and follow the prompts. Choose the default installation options.
  3. After installation, right-click on your desktop and select New > AutoHotkey Script. Name it something like AlwaysOnTop.ahk.
  4. Right-click the new script file and choose Edit Script. This opens Notepad (or your default text editor).
  5. Delete the default text and paste this exact code:
    ^SPACE::
      WinSet, AlwaysOnTop, Toggle, A
    return
    This makes Ctrl+Space toggle the always-on-top property for the currently active window.
  6. Save the file and close the editor.
  7. Double-click the .ahk file to run it. You'll see a green "H" icon in your system tray, meaning the script is active.
  8. Open Notepad, click on its window to make it active, then press Ctrl+Space. The window will stay on top. Press the same shortcut again to undo.

Method 3: PowerShell (No Extra Software, but Temporary)

  1. Open Notepad and leave it open.
  2. Press Win + X and select Windows PowerShell (Admin) or Terminal (Admin).
  3. In the PowerShell window, run this command (replace "Notepad" with the exact title of your Notepad window if it's not the default):
    Add-Type '
    using System;
    using System.Runtime.InteropServices;
    public class Win32 {
      [DllImport("user32.dll")]
      public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags);
    }'
    $proc = Get-Process -Name notepad | Select-Object -First 1
    $hwnd = $proc.MainWindowHandle
    [Win32]::SetWindowPos($hwnd, (New-Object IntPtr -ArgumentList -1), 0, 0, 0, 0, 0x0001 -bor 0x0002)
    This sets the window to be always on top. However, the effect is lost when you close Notepad or restart the system.
  4. To turn it off, run the same command but replace -1 with -2 (which means "bottom") or simply close Notepad.

Common Mistakes

  • Forgetting to run DeskPins or AutoHotkey after reboot: Both tools need to be running for the always-on-top feature to work. If you restart your PC, you must launch them again. To make them start automatically, place a shortcut in the Startup folder (Win+R, type shell:startup, and drop the .exe or .ahk file there).
  • Clicking the pin icon but not clicking the window: With DeskPins, you must click the window's title bar after clicking the tray icon. If you just click the tray icon and then move the mouse away, nothing happens.
  • Using the wrong AutoHotkey shortcut: The script uses Ctrl+Space. If you have another program using that shortcut (like a language switcher), it may conflict. You can change the shortcut in the script to something else, like ^!SPACE (Ctrl+Alt+Space).
  • Running PowerShell without admin rights: The PowerShell method may fail if you don't run it as administrator, especially if your user account has restrictions. Always right-click and choose "Run as administrator".

Tips

  • DeskPins works with any window, not just Notepad. You can pin your calculator, browser, or any app.
  • If you prefer a more modern utility, try Always on Top from the Microsoft Store (free, by Daan Systems). It adds a small button to the title bar of any window.
  • In AutoHotkey, you can make the script start on boot by placing a shortcut in the Startup folder as mentioned.
  • If you use multiple monitors, always-on-top windows will stay on top on whichever monitor they are located.
  • For a quick temporary fix without any software, you can use the Windows 11 Snap Layouts (hover over the maximize button) to make Notepad take half the screen, but that doesn't keep it on top of other windows—it just splits the screen.

Troubleshooting

If the pin doesn't appear on Notepad: Make sure DeskPins is running (check the system tray). If it is, try restarting DeskPins by right-clicking its tray icon and selecting Exit, then relaunch. Also, ensure you're clicking the exact title bar area, not the menu bar.

If AutoHotkey script doesn't work: Double-check that you pasted the code exactly as shown. The script must be saved with a .ahk extension. If you get an error when running it, right-click the script and select "Compile Script" to create an .exe, then run that. Also, make sure you're pressing the shortcut while the Notepad window is active (click on it first).

If PowerShell throws an error: The command is long and must be pasted as a single block. If you get a syntax error, copy it again from this guide. If you get "Access denied" or "not recognized", run PowerShell as administrator. If Notepad is not the active process, the command may fail—close all other Notepad windows and try again.

If the always-on-top stops after a few seconds: Some applications (like full-screen games) may override it. Also, if you use a window manager or a third-party theme, it might interfere. Try the other method to see if it persists.

Frequently Asked Questions

Does Windows have a native always-on-top feature for Notepad?

No, Windows does not provide a built-in toggle for always-on-top in Notepad or any standard app. You need a third-party tool or a script.

Will DeskPins work with the new Notepad from the Microsoft Store?

Yes, DeskPins works with any window that has a standard title bar, including both the classic Notepad and the newer Store version.

Can I make the always-on-top setting permanent for Notepad?

With DeskPins or AutoHotkey, you can set the script to run at startup and even auto-pin Notepad when it opens, but it's not a system-wide setting. You'd need to write a more advanced AutoHotkey script that detects when Notepad opens and pins it automatically.

Is it safe to use these third-party tools?

Yes, DeskPins and AutoHotkey are well-known, open-source or freeware tools. Download them only from official or reputable sources to avoid malware.

Does always-on-top work when Notepad is in fullscreen?

No, if you maximize Notepad (fullscreen), it will cover the entire screen, and always-on-top becomes irrelevant because there's nothing behind it. The feature works best in a normal window.

Can I use this on Windows 7 or 8?

Yes, DeskPins and AutoHotkey work on older Windows versions as well. The PowerShell method also works on Windows 7, but you may need to adjust the command slightly for older PowerShell versions.