Skip to Content
Sindre Sorhus
Back to Actions

Updated

How to Generate a UUID in Shortcuts on iPhone and Mac

By Sindre Sorhus, who makes the Actions app

With Actions

  1. Install Actions, and open it once.
  2. In your shortcut, add the “Generate UUID” action of Actions. It has no options.
  3. Use its result, “UUID”, in the next action, like in the name of a file, or as the ID of a new row in a table.

Each run gives a new UUID, in capital letters with hyphens.

Get Actions

Additional actions for the Shortcuts app

Download on the App Store

Free

Requires
macOS, iOS, or visionOS 26 or later
Updated
June 2026
US App Store rating
4.8/5 (709 ratings)

More about Actions

Without an app

On Mac, Shortcuts can run the uuidgen command of macOS:

  1. In your shortcut, add the “Run Shell Script” action.
  2. Type uuidgen in the action.
  3. If the shortcut cannot run the script, choose “Shortcuts › Settings”, click “Advanced”, and turn on “Allow Running Scripts”.

The result is the same kind of UUID. This is fine for a shortcut that only runs on your Mac. iPhone and iPad have no “Run Shell Script” action, so a shortcut that must also run there needs the action of Actions.