How to List All Packages Installed with Homebrew on Mac

There are many situations where you may wish to get a list of all Homebrew packages installed on a Mac, specifically that were installed using Homebrew, and not anything else.
If you’re not familiar, Homebrew is a popular command line package manager for Mac, and many advanced Mac users use it to install additional software into Terminal or even GUI apps with Homebrew’s cask.
Let’s review two different ways to determine what packages were installed on a Mac using Homebrew.
List All Installed Packages with brew list
The simple ‘brew list’ command will list all packages that have been installed with Homebrew, both with formulae and with cask.
brew list
You may see the command report something like this back:
# Formulae
ca-certificates htop libusb openssl@3 smartmontools
gdbm irssi lynx pcre sqlite
gettext libffi mpdecimal pcre2 webkit2png
git libidn2 ncurses python@3.9 wget
glib libunistring openssl@1.1 readline xz
# Casks
unofficial-wineskin
See All Installed Packages with brew leaves
The ‘brew leaves’ command will provide a list of installed packages with Homebrew, but not include casks:
brew leaves
Which may return something like the following:
$ brew leaves
git
htop
irssi
libffi
libusb
lynx
pcre
python@3.9
smartmontools
webkit2png
wget
You can use either the ‘brew list’ or ‘brew leaves’ command, whichever better suits your situation.

