.AHK

AHK File

AutoHotkey Script
Ask a question
QUICK ANSWER

An AHK file is an AutoHotkey script - a plain-text program for Windows that remaps keys, expands text shortcuts, and automates repetitive tasks. To run it, install AutoHotkey from autohotkey.com and double-click the file. Always open an unfamiliar .ahk in a text editor before running it, since scripts have full control over your keyboard, mouse, and files.

Developer: AutoHotkey Foundation (originally Chris Mallett; now community/Lexikos) Category: Executable Files Open standard MIME: text/plain
OPENS ON Windows
Related: .APK · .EXE · .VBS · .JAR

On this page

19k+ extensions indexed
Last reviewed Aug 3, 2026

Not sure what your file is?

Drop any file into our identifier - we read just the first bytes to name the format.

Identify a file

What is the AHK file format?

.ahk is a plain-text script file used by the AutoHotkey application. AutoHotkey is used for automating GUI tasks and keyboard and mouse interactions by executing code in .ahk files. .ahk files can be edited manually with any text editor, but the process requires working knowledge of the AutoHotkey scripting language. Errors in .ahk files may cause the script to not work properly or at all.

The AutoHotkey program is capable of automating execution of pointer and keyboard commands in various applications, including games, and can be used to create macros and hotstrings. AutoHotkey offers users the option to create custom key mappings to launch scripts or trigger actions. Scripts typically include directives such as #Requires AutoHotkey v2.0 or #SingleInstance Force, hotkey definitions, functions, and comments beginning with ;.

As of December 2022, AutoHotkey v2 introduced a modernized syntax incompatible with v1; v1.1 remains actively maintained. .ahk scripts can also be compiled to a standalone .exe using the included Ahk2Exe tool. Like .bat and .ps1 scripts, .ahk files are human-readable plain text but carry significant system access - always inspect untrusted scripts before running.

Security & safety

RISK: MEDIUM

An .ahk is executable automation: it can send keystrokes, move the mouse, read/write files, run programs and access the network, so a malicious script can do real harm even though the file is plain text. Always open an unfamiliar .ahk in a text editor first and read it before running - never blindly double-click one received by email or download. Compiled .ahk-to-.exe versions hide the source, so treat unknown AutoHotkey EXEs with the same caution as any downloaded program. AutoHotkey itself is safe; download it only from autohotkey.com.

Format details

in a nutshell
FULL NAMEAutoHotkey Scriptaka AutoHotkey script file, AHK script
DEVELOPERAutoHotkey Foundation (originally Chris Mallett; now community/Lexikos)since 2003 (AutoHotkey 1.0)
MIME TYPEtext/plain
TYPEPlain-text automation/macro script (interpreted)
STANDARDOpen · royalty-free

Programs that open AHK files

Windows4 apps
AutoHotkey Open-source Install AutoHotkey, then double-click the .ahk to run it. Right-click > Edit Script to open it in your editor.
Windows Notepad Built-in Right-click the .ahk > Open with > Notepad to read the script before running it.
Notepad Open-source Open the .ahk to view or edit the script text safely without running it.
Visual Studio Code Free Open the .ahk to read/edit it; add an AutoHotkey extension for syntax highlighting and run/debug.

Technical details

deep spec
MIME typetext/plain (no dedicated MIME; some servers fall back to application/octet-stream)
Character encodingUTF-8 (leading BOM EF BB BF common) or ANSI; v1 also reads the system codepage
File signatureNone - plain text; v2 scripts commonly open with #Requires AutoHotkey v2.0
Language versionsTwo incompatible syntax generations: v1 (legacy, maintained as v1.1) and v2 (modern, released December 2022)
Operating systemWindows only; no official runtime for macOS or Linux
Execution methodInterpreted at runtime by AutoHotkey.exe; scripts can also be invoked from the command line
CompilationCompiles to a standalone .exe via the bundled Ahk2Exe tool, which packages the interpreter and script together
Script constructsHotkey labels (e.g. ^j::MsgBox), hotstrings, directives (#Requires, #SingleInstance), functions, classes (v2), and labels
Typical file sizeA few hundred bytes to tens of KB (plain text source)
Developer / maintainerOriginally created by Chris Mallett (2003); now maintained by the AutoHotkey Foundation and community (lead: Lexikos)
System access scopeFull access to keyboard input, mouse, file system, clipboard, and running processes
Common use casesGUI automation, custom hotkeys, text expansion via hotstrings, window management, scripted file operations
v2 breaking changesMandatory parentheses for function calls, expression-mode by default, stricter variable scoping - backward-incompatible with v1
Common directives#Requires, #SingleInstance, #Include, #NoEnv (v1 only), #Warn
Released2003 (AutoHotkey 1.0)
Latest versionAutoHotkey v2 (v2.0 released December 2022; v1.1 still maintained)
Open standardYes · royalty-free
Specificationwww.autohotkey.com

AHK conversions

Community Q&A

asked by users
Ask a quick question
Get help from people who work with AHK files. Be specific - include your system and software version.
No account needed · answers usually within a day

No questions yet - be the first to ask about AHK files.

Frequently asked questions

How do I run an AHK file?
Install AutoHotkey from autohotkey.com, then double-click the .ahk. A tray icon appears while it runs; right-click it to pause or exit.
How do I open an AHK file to edit it?
Right-click the script and choose Edit Script, or open it in Notepad, Notepad++ or VS Code. It's plain text.
Why won't my AHK script work?
Most often a version mismatch: the script was written for AutoHotkey v1 but you have v2 installed (or vice versa). Check the top for '#Requires AutoHotkey v2.0' and install the matching version.
Can I convert an AHK script to an EXE?
Yes - use Ahk2Exe (bundled with AutoHotkey): right-click the .ahk and Compile Script, or run Ahk2Exe to build a standalone Windows executable.
Does AutoHotkey work on Mac or Linux?
No, AutoHotkey is Windows-only. On macOS/Linux use alternatives like AutoKey or Hammerspoon; .ahk scripts won't run there as-is.
Is it safe to run an AHK file someone sent me?
Only if you trust it. A script can control your keyboard, files and programs. Open it in a text editor and read it first; don't run unknown .ahk files.

References

1AutoHotkey - Official documentationwww.autohotkey.com
2AutoHotkey v2 - Changes from v1www.autohotkey.com

Keep exploring

across the database

Top extensions this week

1.AQQAQQ Instant Messenger File
2.CRDOWNLOADChrome Partial Download File
3.BINCD/DVD Disc Image (BIN/CUE)
4.DATProgram Data File (generic)
5.PARTPartial Download File
6.EXEWindows Executable (Portable Executable)
7.NOMEDIAAndroid No-Media Marker File
8.RPMSGRestricted Permission Message
9.TMPTemporary File
10.TXTPlain Text File

Related extensions

.APKAndroid Package
.EXEWindows Executable (Portable Executable)
.VBSVBScript file (Visual Basic Script)
.JARJava Archive
.EX4MetaTrader 4 Compiled Program (Expert Advisor / Indicator / Script)
.APPXMicrosoft Windows App Package (AppX)

Free file tools

An in-browser file identifier and image converter - everything runs on your device.

Open the toolbox

Browse file extensions A-Z