.reg

What is a .reg file?

Windows Registry File · Code and data · Microsoft · 1990s

A REG file is a text file that adds or changes Windows Registry settings when you merge it. It is powerful and Windows-only, so read one before you run it and only merge REG files you trust.

Category
Code and data
MIME type
Type
Plain text
Is a .reg file safe to open? Caution. Merging a REG file changes the Windows Registry and can break Windows or be used maliciously. Right-click and Edit to read it as text first, back up the registry, and only merge REG files from a source you trust.

What is a .reg file used for?

A REG file is an export or a script of registry keys and values in a readable text format. Double-clicking it merges those entries into the Windows Registry, which is the central settings database Windows and its programs rely on.

People use REG files to apply a tweak, back up a section of the registry, or restore settings after a reinstall. The same power makes them a favourite of malware, which is why an unexpected .reg deserves suspicion.

The safe way to inspect one is to right-click and choose Edit, which opens it as text in Notepad without changing anything. Only after reading it, and ideally backing up the registry, should you merge it.

REG files only mean something on Windows. On other systems you can read the text, but there is no registry to apply it to.

What opens a .reg file?

The .reg format opens in the following apps, grouped by operating system. If one app does not work, try another from the same list.

Windows

  • Right-click, Edit (view as text, safe)
  • double-click to merge (caution)
  • Notepad

macOS

  • Text editor (to read only)

Linux

  • Text editor (to read only)

Web

  • Any online text viewer (to read only)

Open a .reg file step by step

  1. Confirm the file really is a .reg. Drop it into the WhatFileType identifier, which reads its signature in your browser without uploading anything.
  2. On Windows, open it with Right-click, Edit (view as text, safe) or double-click to merge (caution).
  3. On Mac, use Text editor (to read only).
  4. On Linux, try Text editor (to read only).
  5. Still stuck? Convert the .reg to Not convertible, which opens more widely.

Why can't I open my .reg file?

Almost always because no installed app understands REG. Install one of the apps above, or convert the file to a format your existing software already reads. If double-clicking opens the wrong program instead of nothing at all, the file association is set to the wrong app rather than the file being broken.

The other possibility is that the file is not really a .reg at all. Drop it into the file identifier to check it by its bytes instead of its name. Nothing is uploaded.

How to convert a .reg file

You can convert a .reg file to Not convertible using a conversion tool or the export menu of an app that opens it.

What is the .reg file signature (magic bytes)?

A .reg file starts with the hex bytes 52 45 47 45 44 49 54 34, which read as REGEDIT4 in ASCII. Programs identify REG by those bytes, not by the filename, so a renamed file still gives itself away.

These are the documented signatures for REG.

Documented magic-byte signatures for the .reg format
Hex signatureOffsetASCIINote
52 45 47 45 44 49 54 340REGEDIT4'REGEDIT4' (ANSI); version 5 files are UTF-16 text starting 'Windows Registry Editor Version 5.00'

See the full magic-numbers reference for every format.

Frequently asked questions

What is a .reg file?

A REG file is a text file that adds or changes Windows Registry settings when you merge it. It is powerful and Windows-only, so read one before you run it and only merge REG files you trust.

How do I open a REG file without changing my registry?

Right-click the file and choose Edit (or open it in Notepad). That shows the contents as text so you can read exactly what it would change, without applying anything. Double-clicking, by contrast, merges it into the registry.

Is it safe to run a REG file?

Only if you trust it. Merging a REG file edits the Windows Registry, which can change how Windows behaves or, in the wrong hands, cause harm. Read it first and back up the registry before merging one you did not create.

Related formats

Sources

Details on this page were checked against authoritative references. How sources are ranked and what is deliberately left out is set out in the methodology.