How to Compress and Extract Files With 7-Zip

7-Zip is a free file archiver for Windows that handles everyday compression and a long list of formats you may run into by accident. According to the project's official page, it is free and open source, can be used in commercial organisations without registration or payment, and is mostly licensed under the GNU LGPL. This guide covers the tasks most people need: making an archive, extracting one, protecting it with a password, and a few command-line basics.
What 7-Zip can and cannot do
Knowing the format list saves confusion later. The official page says 7-Zip can both pack and unpack 7z, XZ, BZIP2, GZIP, TAR, ZIP and WIM. It can only unpack a larger set that includes RAR, ISO, MSI, CAB, VHD, DMG and many others. In practice that means you can open a RAR file with 7-Zip but you cannot create one. If someone specifically requires RAR output, you will need other software; for everything else, 7z or ZIP is the better choice anyway.
Choose the format by who will open the file:
- ZIP opens natively in Windows and almost everywhere else. Use it when the recipient is unknown.
- 7z is 7-Zip's own format, using LZMA and LZMA2, and generally gives a smaller file. Use it for your own backups or when the recipient also has 7-Zip.
Install and find the menus
Download the installer from the official site and run it. After installation, 7-Zip adds a submenu to the right-click menu in File Explorer. On newer versions of Windows 11 the submenu may sit under "Show more options"; the 7-Zip File Manager, found in the Start menu, always gives you the same functions in a regular window.
Create an archive
- Select one or more files or folders in File Explorer.
- Right-click, open the 7-Zip submenu and choose the option to add to an archive. A dialog opens.
- Pick the archive format (7z or zip) and, if you wish, change the file name and location.
- Choose a compression level. Higher levels make smaller files but take longer; the default is a sensible balance for most uses.
- Click OK. A progress window appears and the archive is written next to the originals unless you chose another path.
The quick entries in the same submenu create a 7z or zip file with default settings in one click, named after the selected item.
Extract an archive
Right-click an archive and use the extract options in the 7-Zip submenu:
- Extract files lets you pick the destination folder and decide how existing files are handled.
- Extract Here unpacks into the current folder. Be careful with archives that contain many loose files, since they will spill into the folder.
- Extract to a named folder creates a folder named after the archive, which is the safest default.
You can also open an archive in the 7-Zip File Manager, browse inside it, and drag out only the files you need without unpacking everything.
Protect an archive with a password
In the same add-to-archive dialog there is an encryption section where you enter a password and choose the method. The official page states that 7-Zip supports AES-256 encryption for both 7z and ZIP. A few practical points:
- Use a long, unique passphrase and send it to the recipient by a different channel than the archive.
- For the 7z format, the dialog offers a way to encrypt file names as well. Without it, someone can still see which files are inside, even if they cannot open them.
- Older ZIP-compatible encryption is weaker and less widely supported than AES, so choose AES when the dialog gives you the choice.
Archive passwords are suited to sharing a file once. If you want a permanently protected area on your disk that you open and close as a drive, a dedicated tool such as VeraCrypt is built for that job; archive encryption is not a substitute for disk encryption.
Split and self-extracting archives
The same dialog lets you split a large archive into volumes of a chosen size, useful for old size limits on email or removable media. The official feature list also mentions self-extracting 7z archives, which create an executable that unpacks itself on a machine without 7-Zip. Be aware that many mail systems block executable attachments, so a normal archive is usually the safer way to share.
Use the command line
The package includes a command-line version, which is handy for scripts and scheduled backups. The basic pattern is the program name, a command letter, the archive name and the files. In general, "a" adds files to an archive, "x" extracts with full paths and "l" lists contents. Run the program with no arguments to see the built-in help, which is the authoritative reference for switches.
Troubleshooting
"Cannot open file as archive." The download may be incomplete or the file may not be an archive at all. Download it again and check the size.
"Cannot delete or overwrite, file in use." Another program holds the file open. A tool such as Process Explorer from the Sysinternals Suite can show which process has a handle on it, so you can close that program and retry.
A wrong password message. Retype carefully; passwords are case sensitive. If the archive came from someone else, ask them to confirm the passphrase.
Files extracted to the wrong place. Re-run the extraction and pay attention to the destination field, or use the extract-to-folder option.
A sensible routine
For daily use, keep it simple: ZIP for sharing, 7z for your own archives, extract to a named folder, and AES passwords with encrypted names when content is sensitive. Always test an important archive by extracting it once before deleting the originals.
Software in this article
Comments
No comments yet.





