How to Generate a UUID on Mac
Make a UUID on your Mac in a second, without a website: with the uuidgen command, a Raycast snippet, or a Raycast extension that also does v7 UUIDs, ULIDs and TypeIDs.
Make a UUID on your Mac in a second, without a website: with the uuidgen command, a Raycast snippet, or a Raycast extension that also does v7 UUIDs, ULIDs and TypeIDs.
You need an ID for a test fixture, a database row or a config file, and you're about to search "uuid generator" and paste from a random website. Your Mac can do it faster.
The short answer: open Terminal and run uuidgen. It ships with macOS and prints a random UUID. To get one anywhere you type, create a Raycast snippet with the {uuid} placeholder, or install the free UUID Generator extension, which copies v4 and v7 UUIDs, ULIDs and TypeIDs straight to your clipboard.
| Method | Where you get it | v4 | v7 | ULID / TypeID |
|---|---|---|---|---|
| UUID Generator for Raycast | Copied or pasted, from any app | Yes | Yes | Yes |
| Raycast snippet | Typed into any app | Yes | No | No |
uuidgen in Terminal | Terminal | Yes | No | No |
UUID Generator is a free, open-source extension with more than 35,000 installs. Each command generates an ID and copies it to your clipboard, so you never leave the app you're working in.

Open Raycast and type one of these:
user_.In the preferences, set Default Action to Paste to drop the ID straight into the front app instead of the clipboard, and turn on uppercase letters if your project uses them.
Raycast Snippets are built in and free, and they support a {uuid} placeholder.
{uuid | lowercase} (or just {uuid} for uppercase).!uuid.Now type !uuid in any app and Raycast swaps it for a new UUID every time. More on that in our guide to text expansion on Mac.
Every Mac comes with the uuidgen command.
uuidgen and press Return.It prints a random (version 4) UUID in uppercase, like E621E1F8-C36C-495A-93FC-0C247A3E6E5F. A few variations:
# Lowercase
uuidgen | tr '[:upper:]' '[:lower:]'
# Copy to the clipboard, without the trailing newline
uuidgen | tr -d '\n' | pbcopy
# Five at once
for i in {1..5}; do uuidgen; done
uuidgen only does v4. For v7 UUIDs, use a library in your language or the Raycast extension above.
Here's a quick tour of what else it can do, in under seven minutes:
Yes. The uuidgen command ships with macOS. Run it in Terminal and it prints a random version 4 UUID, in uppercase.
Pipe uuidgen through tr: uuidgen | tr '[:upper:]' '[:lower:]'. In a Raycast snippet, use {uuid | lowercase}.
A v4 UUID is fully random. A v7 UUID starts with a timestamp, so new IDs sort after older ones. That makes v7 a better fit for database primary keys. Both are defined in RFC 9562.
In theory, yes. In practice, a random v4 UUID has 122 random bits, so the chance of a collision is too small to worry about for almost any application.
Yes. GUID is Microsoft's name for the same 128-bit identifier. A UUID generated on a Mac works anywhere a GUID is expected.
More guides
Pretty-print messy or minified JSON on Mac without pasting it into a website. Use the Format JSON extension for Raycast, or jq and Python in Terminal.
Install Homebrew, then install, update and remove Mac apps and command-line tools with one command each. Plus how to search and upgrade everything from Raycast without typing brew commands.
Check your download speed, upload speed and ping on Mac without opening a browser. Use the built-in networkQuality command or a Speedtest by Ookla test from Raycast.
Port 3000 already in use? Find out which process is listening on a port and stop it, with lsof and kill in Terminal, Activity Monitor, or the free Port Manager extension.
