To use 7z on a Mac, you first need to install the official 7-Zip command-line tool (or a reputable GUI front-end that uses it), then run it from Terminal with commands like 7z x archive.7z to extract or 7z a archive.7z files to create an archive. macOS does not include 7z support out of the box, so the one-time setup is the main hurdle; after that, the commands are short and consistent.

What You'll Need

  • A Mac running a current version of macOS (the steps below use Terminal, which is built in).
  • Administrator access to install software (you will be asked for your password).
  • Homebrew installed, or a downloaded official 7-Zip package. Homebrew is the simplest way to get the command-line tool and keep it updated.
  • Basic familiarity with Terminal: opening it, typing a command, and pressing Return.

Step-by-Step

  1. Open Terminal. Press Command+Space, type Terminal, and press Return. You can also find it in Applications > Utilities.
  2. Install Homebrew if you do not have it. Paste the official install command from the Homebrew website (brew.sh) into Terminal and press Return. Follow the prompts; you will enter your Mac password. If Homebrew is already installed, skip this step.
  3. Install 7-Zip. In Terminal, run brew install sevenzip. Homebrew installs the official 7-Zip command-line tool. Wait for it to finish; the last lines should confirm the installation.
  4. Check that it works. Run 7z on its own and press Return. You should see a short help screen listing commands. If you see "command not found," see Troubleshooting below.
  5. Navigate to the folder with your archive. Use cd followed by the folder path. For example, if the file is on your Desktop, run cd ~/Desktop. Tip: you can type cd, a space, then drag the folder from Finder into Terminal to fill in the path automatically.
  6. List the archive contents (optional but useful). Run 7z l archive.7z to see what is inside before extracting. Replace archive.7z with your actual file name.
  7. Extract an archive. Run 7z x archive.7z. The x command extracts with full paths. To extract into a specific folder, add -o followed immediately by the folder name, for example 7z x archive.7z -oMyFolder (no space after -o).
  8. Create an archive. To pack files into a new 7z archive, run 7z a archive.7z file1 file2. To add an entire folder, use 7z a archive.7z MyFolder. The a command stands for "add."
  9. Set a password (optional). Add -p to the command, for example 7z a secure.7z MyFolder -p. You will be prompted to type a password. Note that 7z password protection is only as strong as the password you choose; use a long, unique one.
  10. Test the archive (optional). Run 7z t archive.7z to verify the archive is not corrupted. This is a good habit before deleting the original files.
  11. Quit Terminal when you are done. The installed tool stays available for future sessions.

Common Mistakes

  • Typing the archive name without the extension. If your file is photos.7z, type the full name including .7z. Terminal is literal.
  • Forgetting the space after the command. Commands are 7z, a space, then the action letter and file name. 7zx will not work.
  • Putting a space after -o. The output folder flag must be attached: -oMyFolder, not -o MyFolder.
  • Running commands from the wrong folder. If you get "No such file or directory," you are probably not in the folder that contains the archive. Use cd to move there first.
  • Assuming Finder can open 7z files. macOS Archive Utility does not handle 7z natively. You need the 7z tool or a third-party app that supports it.
  • Using an unofficial download. Only install from Homebrew or the official 7-Zip site. Avoid random "7z converter" sites, which can bundle unwanted software.

Tips

  • Use 7z l before extracting an archive you did not create; it shows the file list without unpacking anything.
  • Quote file names that contain spaces, for example 7z x "My Archive.7z".
  • You can drag a file from Finder into Terminal to insert its full path automatically, which avoids typing errors.
  • To extract to the current folder without recreating subfolders, use 7z e archive.7z instead of x. Be careful: this can overwrite files with the same name.
  • Keep Homebrew updated with brew update and brew upgrade so you get fixes to the 7z tool.
  • If you prefer a graphical interface, look for a reputable Mac app that explicitly supports 7z and is distributed through the Mac App Store or the developer's own signed installer. The command-line tool remains the most reliable option.

Troubleshooting

  • "command not found: 7z". The tool is not installed or not on your PATH. Re-run brew install sevenzip. If Homebrew itself is missing, install it first. Close and reopen Terminal after installing.
  • "No such file or directory". Check your current folder with pwd and list files with ls. Move to the correct folder with cd, or use the full path to the archive.
  • "Cannot open file as archive". The file may be corrupted, incomplete, or not actually a 7z file. Run 7z t to test it. If it fails, re-download the file from the source.
  • Password prompt loops or fails. Confirm the password is correct and that Caps Lock is off. If you created the archive, try the exact password again; there is no recovery for a forgotten 7z password.
  • Permission denied when extracting. You may be writing to a protected folder. Extract to your home folder or Desktop instead, or use sudo only if you understand the risks (avoid sudo for routine extractions).
  • Homebrew install fails. Check your internet connection, make sure macOS is up to date, and run brew doctor for hints. If the issue persists, download the official 7-Zip package for macOS from the 7-Zip website and follow its included instructions.

Frequently Asked Questions

Can I open a 7z file on a Mac without installing anything?

No. macOS does not include native 7z support. You need the 7z command-line tool or a third-party app that supports the format.

Is 7z the same as 7-Zip?

7z is the archive file format; 7-Zip is the software that creates and extracts it. The command-line tool is often called 7z.

Does 7z work on Apple Silicon Macs?

Yes. Homebrew installs the correct build for Apple Silicon or Intel Macs automatically.

Can I create a password-protected 7z archive?

Yes. Add -p to the 7z a command and enter a password when prompted. Use a long, unique password; there is no built-in recovery.

Why does Terminal say "command not found" after installing?

Usually the install did not finish or Terminal was open before installation. Close and reopen Terminal, then try 7z again. If it still fails, reinstall with Homebrew.

Can I use 7z to extract other formats like zip or tar?

Yes, 7z can extract many common archive formats, including zip and tar, in addition to 7z. The same x command works.