# How to Shuffle a List in Shortcuts on iPhone and Mac

Updated: November 24, 2026

- [Actions](https://sindresorhus.com/actions.md): Additional actions for the Shortcuts app. Price: Free. Platforms: macOS, iOS, visionOS. Get it from: [App Store](https://apps.apple.com/app/id1586435171). Requires macOS, iOS, or visionOS 26 or later. Size: 13 MB on Mac, 29 MB on iPhone and iPad. Free older versions for macOS 15, 14, 13, and 12: [download](https://sindresorhus.com/actions#older-versions). US App Store rating: 4.8/5 (703 ratings).

URL: https://sindresorhus.com/guides/shortcuts-shuffle-list

Add the “Shuffle List” action of the free [Actions](https://sindresorhus.com/actions.md) app after the action that makes the list. [Without an app](https://sindresorhus.com/guides/shortcuts-shuffle-list#without-an-app), the “Get Item from List” action of Shortcuts can get one random item, and on Mac, a “Run Shell Script” action can shuffle a list of text.

## With Actions

1. Install [Actions](https://sindresorhus.com/actions.md), and open it once.
1. In your shortcut, add the [“Shuffle List”](https://sindresorhus.com/actions#:~:text=Shuffle%20List) action below the action that makes the list, and select the list in the action. On iPhone, touch and hold the field to choose a variable.
1. To get only some of the items, expand the action, turn on “Limit”, and type the number in “Maximum Results”.

The result is “Shuffled List”. It has each item one time, so “Limit” gives random items without repeats, like 3 winners from a list of names. It works with any list, also files and photos.

- If Shortcuts says that it “couldn’t convert from Text to NSString”, change the preview of the result to the list view. This is a bug in the Shortcuts app.
- To put the list in the opposite order, use “Reverse List”. To sort it, [use “Sort List”](https://sindresorhus.com/guides/shortcuts-sort-list.md).

## Without an app

For files and photos, the “Filter Files” and “Find Photos” actions can sort by “Random”. For a list of text, Shortcuts has no action that shuffles it. On Mac, add a “Run Shell Script” action after the list, with the list as its input, and use the command `sort -R`. Its result is the text with the lines in a random order. A script needs “Allow Running Scripts”: choose “Shortcuts › Settings”, click “Advanced”, and turn it on. On iPhone, for one random item, add the “Get Item from List” action, and choose “Random Item”.

To get more random items, you can put “Get Item from List” in a “Repeat” action. But the same item can come more than one time, so this is not good for a draw.
