What is the REG file format?
Windows registry files can be saved with the .reg extension. It is a plain-text file that can be opened in any text editor - to read it safely, right-click and choose Edit rather than double-clicking, which merges its contents directly into the registry. A Registry file is created when registry keys are exported for backup purposes before making changes to the registry. .reg files can then be used to import those keys back and restore settings.
.reg file format - how information is stored
The Windows Registry is a hierarchical database that stores system, application, and hardware settings. .reg files encode that data in a structured plain-text layout similar in appearance to a .ini file. Modern files (Windows 2000 and later) are encoded as UTF-16 LE and begin with the header line Windows Registry Editor Version 5.00; legacy files from the Windows 9x era use the REGEDIT4 header and ANSI encoding. Each .reg file contains:
- header line - the registry-editor identifier (
Windows Registry Editor Version 5.00orREGEDIT4) - key-path sections - registry entry paths with the syntax
[<Hive name>\<Key name>\<Subkey name>] - value name lines -
"Value name"=<type>:<data>, where the type prefix may bedword:,hex:,hex(2):, and so on; string values (REG_SZ) use a bare quoted form - default value - written as
@=instead of a named entry - deletion markers -
[-HKEY...]removes an entire key;"name"=-deletes a single value
Each new value uses a new line.
How are Windows .reg files used?
.reg files can import or export registry data. They are applied by regedit.exe - double-clicking triggers a UAC and confirmation prompt, then merges the entries into the live registry - or by the command-line reg.exe utility. Unlike a .bat script, a .reg file cannot run arbitrary commands; it only adds, updates, or deletes registry entries. It is strongly advised to back up the registry before applying any .reg file and to review its contents in a text editor first. Depending on the changes made, it may be necessary to restart the system.
Security & safety
RISK: HIGHThis is the key fact for .reg files: double-clicking one MERGES it into your Windows Registry, changing system/app settings immediately after a UAC + confirmation prompt - it does not just open for viewing. A malicious .reg can disable Windows Defender/Update prompts, add auto-start malware, change file associations, or break the OS, and entries prefixed with '-' delete keys. Safe practice: NEVER run a .reg from an untrusted source; right-click > Edit to read it in Notepad first, export a backup of the affected branch (regedit > File > Export), and only then apply. Beware "registry cleaner/optimizer" tools advertised alongside .reg files - many are low-value or bundle adware (PUPs); Windows needs no third-party app to handle .reg.
Format details
in a nutshellPrograms that open REG files
Technical details
deep spec| File encoding | UTF-16 LE with optional FF FE BOM (modern, Windows 2000+); ANSI (legacy REGEDIT4, Windows 9x) |
| Format identifier | First line is always a header string: "Windows Registry Editor Version 5.00" (modern) or "REGEDIT4" (legacy) |
| MIME type | text/plain |
| Structure | Header line, then [HKEY_...\Key\Subkey] section blocks, each containing "ValueName"=type:data lines; blank lines separate sections |
| Supported data types | REG_SZ (quoted string), REG_DWORD (dword:), REG_BINARY (hex:), REG_EXPAND_SZ (hex(2):), REG_MULTI_SZ (hex(7):), REG_QWORD (hex(b):) |
| Default value syntax | @= denotes the unnamed default value of a key |
| Key deletion syntax | Prefix the key path with a minus sign: [-HKEY_...\Key] |
| Value deletion syntax | Assign a hyphen as the data: "ValueName"=- |
| Line continuation | Long hex/binary values may be split across lines using a trailing backslash (\) |
| Import method | Double-click invokes regedit.exe and merges entries after a UAC + confirmation prompt; CLI: reg import file.reg |
| Compression | None - plain text |
| Checksum / integrity | None - no built-in checksum or digital signature |
| Platform support | Windows only; treated as plain text on macOS and Linux with no registry effect |
| Associated tools | Registry Editor (regedit.exe), reg.exe (command-line import/export/query) |
| Released | Windows 95 (.reg import/export); current text format since Windows 2000/XP |
| Latest version | Windows Registry Editor Version 5.00 (UTF-16, since Windows 2000) |
| Specification | learn.microsoft.com |
REG conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about REG files.