How to generate a UUID on a Mac

Make a random UUID on your Mac with the built-in uuidgen command, in lowercase if you need it, or with one click from the MacBook notch.

By Rudra Satani, maker of NotchMind ·

With uuidgen

macOS includes uuidgen:

uuidgen

It prints a random version 4 UUID in uppercase, like 3F2504E0-4F89-41D3-9A0C-0305E82C3301.

Lowercase, straight to the clipboard

uuidgen | tr '[:upper:]' '[:lower:]' | pbcopy

Many databases and APIs use lowercase, so this is the version most developers want.

Several at once

for i in {1..5}; do uuidgen; done

From the notch

NotchMind, which I make, has UUID v4 on its Developer Tools page. Open the notch, pick it, press the button, then Copy result. No Terminal needed. See developer tools in the notch.

Is it unique?

A version 4 UUID has 122 random bits. You can treat a newly generated one as unique for any practical purpose.

About the author

Rudra Satani makes NotchMind, a notch app for Mac, so read anything about notch apps here with that in mind. Spotted a mistake? Email support@notchmind.com, or reach out at @rudraxx13.