DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk10 min

Randomize Photos in a Folder [Step-By-Step Guide 2024]

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When people say they want to randomize photos in a folder, they usually mean one of two things: (1) change the filenames so any “sort by name” workflow plays them in a random order, or (2) create a shuffled copy for viewing/export.

There’s no universal “random order” switch for a folder. File managers and apps typically sort by name, date, or metadata—so the most reliable method is shuffling filenames or building a new shuffled folder.

As an Amazon Associate I earn from qualifying purchases.

This guide gives you safe, 2024-friendly ways to do it on Windows, macOS, and mobile workflows, with exact commands and steps.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why photo order matters (and what you can/can’t randomize)

File order in a folder isn’t guaranteed. Even if a viewer shows photos in a certain sequence, the underlying order can be based on OS indexing, filesystem behavior, or app-specific sorting.

#1 Best Overall
Sale
WD 2TB Elements Portable External Hard Drive for Windows, USB 3.2 Gen 1/USB 3.0 for PC & Mac, Plug and Play Ready - WDBU6Y0020BBK-WESN
  • High capacity in a small enclosure – The small, lightweight design offers up to 6TB* capacity, making WD Elements portable hard drives the ideal companion for consumers on the go.
  • Plug-and-play expandability
  • Vast capacities up to 6TB[1] to store your photos, videos, music, important documents and more
  • SuperSpeed USB 3.2 Gen 1 (5Gbps)

Most slideshow/photo workflows sort predictably. Common patterns are “Sort by Name” or “Sort by Date Taken.” If you need a truly random order, you generally have to randomize the inputs those workflows sort on.

  • If your app sorts by filename, shuffling names is the most dependable approach.
  • If your app sorts by date stored in EXIF, you’ll need a different strategy (often more involved) and you may risk altering metadata.
  • If you only need a random playback, you may not need to rename files at all—some tools can shuffle at playback time.

Prerequisites and safety checklist

You’ll avoid 90% of headaches by preparing up front.

  • Have a backup: copy the folder somewhere safe (or use the “shuffled copy” methods below).
  • Know your file types: typical extensions are .jpg, .jpeg, .png, and sometimes .heic.
  • Decide between two goals:
    • Shuffled copy (recommended): originals stay untouched.
    • Rename in place: faster, but you’re changing filenames.
  • Watch for numbering collisions: renaming must ensure every target name is unique.

If your folder contains non-photo files (screenshots, PDFs, videos), filter by extension so you don’t end up shuffling the wrong items.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Method 1 (Recommended): Create a shuffled copy by renaming or exporting

The safest “randomize photos in a folder” workflow is to copy the images into a new folder while applying randomized filenames (or randomized numbering). That way, you can revert easily or discard the shuffled folder.

Use the platform-specific steps below, then point your slideshow/export tool at the new shuffled folder.

Windows (PowerShell) — Randomize photos in a folder

PowerShell works well because it can gather filenames, randomize their order in memory, then copy/rename with a consistent pattern.

Option A: Make a shuffled copy (no original changes)

Use this when you want to preserve originals and still get a random order for “sort by name.”

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Open PowerShell (Start menu → type PowerShell → open it).
  2. Run this command to set variables. Replace paths and extension list as needed:

$src = "C:\Users\YOURNAME\Pictures\PhotosToShuffle";

$dst = "C:\Users\YOURNAME\Pictures\PhotosToShuffle_Shuffled";

$ext = @(".jpg",".jpeg",".png",".heic");

  1. Run the full script:

New-Item -ItemType Directory -Force -Path $dst | Out-Null;

$files = $ext | ForEach-Object { Get-ChildItem -Path $src -File -Filter $_ };

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
WD 2TB My Passport, Portable External Hard Drive, Black, backup software with defense against ransomware, and password protection, USB 3.1/USB 3.0 compatible - WDBYVG0020BBK-WESN
  • Slim durable design to help take your important files with you
  • Vast capacities up to 6TB[1] to store your photos, videos, music, important documents and more
  • Back up smarter with included device management software[2] with defense against ransomware
  • Help secure your important files with password protection and hardware encryption
  • 3-year limited warranty

$shuffled = $files | Sort-Object { Get-Random };

$pad = 6;

$shuffled | ForEach-Object -Begin { $i = 0 } -Process { $i++; $n = $i.ToString().PadLeft($pad,'0'); $newName = "IMG_${n}$($_.Extension)"; Copy-Item -LiteralPath $_.FullName -Destination (Join-Path $dst $newName) -Force;

};

  1. Open the new folder. If your slideshow sorts by name, the order will be randomized because filenames start at IMG_000001 etc.

Option B: Rename in place (fast, but changes filenames)

This is useful if you don’t want a copy and your downstream app only cares about the filename order. Back up first.

  1. Set your source path and extension list:

$src = "C:\Users\YOURNAME\Pictures\PhotosToShuffle";

$ext = @(".jpg",".jpeg",".png",".heic");

  1. Run this script:

$files = $ext | ForEach-Object { Get-ChildItem -Path $src -File -Filter $_ };

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

$shuffled = $files | Sort-Object { Get-Random };

$pad = 6;

$i = 0;

# Step 1: rename to temp names to avoid collisions

$shuffled | ForEach-Object { $i++; $temp = "__TMP_${i.ToString().PadLeft($pad,'0')}__$($_.Name)"; Rename-Item -LiteralPath $_.FullName -NewName $temp;

};

# Step 2: rename temp names to final shuffled names

$i = 0;

Get-ChildItem -Path $src -File -Filter "__TMP_*" | Sort-Object { $_.Name } | ForEach-Object { $i++; $n = $i.ToString().PadLeft($pad,'0'); # Recover extension from original name $extn = [System.IO.Path]::GetExtension($_.Name); $newName = "IMG_${n}$extn"; Rename-Item -LiteralPath $_.FullName -NewName $newName; };

What this does: it renames everything to temporary unique names first, then assigns final shuffled names. That avoids collisions when two files share the same original base name patterns.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Troubleshooting Windows issues

  • “Access denied”: run PowerShell as Administrator, or make sure the folder isn’t inside a restricted sync folder (some locked OneDrive states behave differently).
  • No files copied: verify extensions. For iPhone photos, many files are .HEIC (uppercase). PowerShell filters are usually case-insensitive, but your setup could vary.
  • Wrong randomization: if you sort after copying, use a viewer that truly sorts by name. Some apps ignore filenames and use metadata.
  • Long filenames: destination names like IMG_000001.jpg are short; that’s why the scripts use a fixed pattern.

macOS (Terminal) — Randomize photos in a folder

macOS command-line shuffling is straightforward with bash and utilities like shuf. If you don’t have shuf (rare on modern macOS), see the fallback note below.

Option A: Copy to a new shuffled folder

Best for safety—originals remain unchanged.

  1. Open Terminal (Spotlight → Terminal).
  2. Create the destination and run this command. Replace paths:

src="/Users/$(whoami)/Pictures/PhotosToShuffle"

dst="/Users/$(whoami)/Pictures/PhotosToShuffle_Shuffled"

mkdir -p "$dst"

# Gather files (edit extensions as needed)

files=("$src"/.jpg "$src"/.jpeg "$src"/.png "$src"/.HEIC "$src"/*.heic)

Rank #3
Sale
Aiolo Innovation 500GB External Hard Drive Ultra Slim Portable HDD-USB 3.0 for PC, Mac, Laptop, PS4, Xbox one,Xbox 360 HD-A4
  • Ultra fast data transfers: the external hard drive works with USB 3.0 thickened copper cable to provide super fast transfer speeds. Theoretical read speed is as high as 110MB/s-133MB/s and write speed is as high as 103MB/s.
  • Ultra-thin and quiet: the motherboard adopts a noise-free solution, giving you a quiet working environment. Lightweight and portable size designed to fit in your pocket for easy portability.
  • Compatibility: compatible with PS4/xbox one/Windows/Linux/Mac/Android,Stable and fast downloading on game console no difference from fast transmission when using on PC.
  • Plug and Play: no software to install, just plug it in and the drive is ready to use. The hard drive chip is wrapped with aluminum anti-interference layer to increase heat dissipation and protect data
  • Package Contents: 1* portable hard drive, 1 *USB 3.0 cable, 1*USB to type C adapter,1 *user manual, shell packaging, three-year manufacturer's warranty and free technical support services

# Filter out non-matches (mac shells keep literal globs if no match)

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

real_files=()

for f in "${files[@]}"; do [ -e "$f" ] && real_files+=("$f")

done

# Shuffle and copy with sequential randomized names

idx=1

printf "%s\n" "${real_files[@]}" | shuf | while read -r f; do ext="${f##*.}" printf -v n "%06d" "$idx" cp -p "$f" "$dst/IMG_${n}.$ext" idx=$((idx+1))

done

  1. Open PhotosToShuffle_Shuffled and confirm your viewer sorts by name.

Option B: Rename in place

This is faster but changes filenames. Do this only if you’re comfortable updating references.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Run Terminal and execute this template after replacing paths:

src="/Users/$(whoami)/Pictures/PhotosToShuffle"

cd "$src" || exit 1

# Build a list of candidate files

files=( .jpg .jpeg .png .HEIC *.heic )

real=()

for f in "${files[@]}"; do [ -e "$f" ] && real+=("$f")

done

# Shuffle order

printf "%s\n" "${real[@]}" | shuf | nl -w1 -s- -v1 | while read -r line; do # line looks like: 1-actualfilename.ext idx="${line%%-*}" name="${line#*-}" n=$(printf "%06d" "$idx") ext="${name##*.}" # Temporary rename to avoid collisions tmp="__TMP_${n}__.$ext" mv -n "$name" "$tmp" && mv -n "$tmp" "IMG_${n}.$ext"

done

Troubleshooting macOS issues

  • No shuf: on very old systems, install coreutils via Homebrew (brew install coreutils) and use gshuf instead of shuf.
  • HEIC extension case: the script includes both .HEIC and .heic`. If your camera uses other variants, add them.
  • Spaces in filenames: using quoted variables and reading lines prevents most issues. Still, if you see failures, remove problematic files or rename them temporarily.

Linux (Bash) — Quick shuffle script

If you prefer a single reusable snippet, Linux makes it easy.

  1. Open a terminal in the folder containing your photos or set src explicitly.
  2. Run:

src="/home/you/Pictures/PhotosToShuffle"

dst="/home/you/Pictures/PhotosToShuffle_Shuffled"

mkdir -p "$dst"

shopt -s nullglob

files=("$src"/.jpg "$src"/.jpeg "$src"/.png "$src"/.heic "$src"/*.HEIC)

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

count=${#files[@]}

if [ "$count" -eq 0 ]; then echo "No matching files found. Check extensions." >&2 exit 1

fi

i=1

printf "%s\n" "${files[@]}" | shuf | while read -r f; do ext="${f##*.}" n=$(printf "%06d" "$i") cp -p "$f" "$dst/IMG_${n}.$ext" i=$((i+1))

Rank #4
YOTUO 1TB External Hard Drive, Portable Storage Expansion HDD, USB 3.0 & USB-C for PC, Mac, Desktop, Laptop, Smartphone, PS4, Xbox One, Xbox 360, Office & Game, Black
  • 【Versatile Storage Expansion – For Gaming, Work & Everyday Use】 Running out of space on your PS5 or Xbox Series X/S? This external hard drive lets you store and play PS4 / Xbox One games directly, instantly freeing up your console’s internal storage for next‑gen titles. At the same time, it handles work file backups, media libraries, and cross‑device data transfers with ease. One drive, all your needs. *(Note: PS5 / Xbox Series X|S games cannot be run or stored directly from the external hard drive. However, by offloading your PS4 / Xbox One games, you can free up valuable space for newer titles.)*
  • 【Patented Silicone Sleeve – Data Protection You Can Count On】 Worried about drops? We’ve got you covered. The patented built‑in silicone sleeve acts like a shock‑absorbing armor, cushioning your drive against bumps and falls. Whether it’s important work documents, precious family photos, or hard‑earned game saves, your data deserves this level of protection.
  • 【Plug & Play, Compatible with Computers & Consoles】 No complicated setup—just plug in and go. Works seamlessly with Windows, Mac, and Linux computers, as well as PS4, PS5, Xbox One, and Xbox Series X/S. Process files at the office, back up data at home, or enjoy gaming in your downtime—one drive handles all your devices, simply and hassle‑free.
  • 【USB 3.0 Ultra‑Fast Transfer – No More Waiting】 Tired of watching progress bars crawl? With USB 3.0 speeds up to 5Gbps, large files transfer in seconds. Whether you’re moving work documents, transferring hundreds of gigs of games, or backing up a year’s worth of photos, you get more done in less time.
  • 【Sleek, Lightweight, and Ready to Go】 Weighing just 0.16 kg—lighter than a can of soda—this compact drive features a stylish mirror‑and‑frosted finish. Toss it in your bag and go, whether you’re heading to the office, visiting a friend for a gaming session, or giving a presentation on the road.

done

iPhone and iPad (Shortcuts) — Shuffle for an album or slideshow workflow

On iPhone/iPad, the Photos app doesn’t provide a simple “randomize filenames in a folder” because photos are managed by the system, not as normal files in a desktop-like folder.

What you can do instead is randomize playback order using Shortcuts—especially if your goal is a slideshow, share sequence, or exported set.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Open Shortcuts app on iPhone or iPad.
  2. Create a new shortcut: tap +.
  3. Add action Find Photos. Choose a smart filter or a specific album if available.
  4. Add action Get Details of Photos (if needed to select only certain types).
  5. Add action Shuffle (if your Shortcuts version includes it). If you don’t see Shuffle, use a method like generating random numbers per item and sorting by those numbers (depends on iOS version and available actions).
  6. Add action Show Results or Share to export/share in the randomized order.
  7. Test with a small album first, then run again for the full set.

Because iOS action availability changes by iOS release, if Shuffle isn’t present in your version, tell me your iOS version and the exact workflow you want (slideshow, share sheet, or export) and I’ll map a working action chain.

Android — Practical alternatives when you only need random playback

Android file handling is app-dependent. Many gallery apps offer sorting options like “Recently added,” but not true shuffle.

If your aim is random playback rather than renaming, practical options include:

  • Use a viewer/app that supports shuffle: some media players and slideshow apps include a “shuffle” mode.
  • Export to a PC for shuffling: copy photos from your device to Windows/macOS, run the shuffled copy method, then view the shuffled folder.
  • Cloud album workflows: services sometimes allow randomized slides, but behavior varies and is not guaranteed.

If you tell me your gallery app name (Google Photos, Samsung Gallery, etc.) and your exact goal (slideshow, share, screen saver), I can recommend the most reliable path for that specific stack.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How to verify the shuffle worked

After running any shuffle method, you want quick confirmation that the sequence is actually random—not just a different numbering pattern.

  • Spot-check filenames: confirm they follow the pattern (e.g., IMG_000001 … IMG_000050).
  • Compare with original order: sort the original folder by name or date and compare the first 5 photos against the shuffled folder. With enough images, the chance they match is low.
  • Count files: make sure the shuffled folder has the same number of photos as the original. On Windows: check folder properties; on macOS/Linux: run ls | wc -l.

If counts don’t match, it usually means your extension filters missed some files (common with .jpeg vs .JPG, or HEIC variants).

Common mistakes and gotchas

These are the issues that show up repeatedly when people randomize photos in a folder.

  • Renaming in place breaks “missing media” links: if another app tracks photos by filename, renaming can cause it to re-index or lose references.
  • Sorting by metadata instead of filename: if your slideshow uses EXIF date/time, filename randomization won’t change the order.
  • Mixed media types: if your folder contains videos or documents, include only the intended photo extensions.
  • Duplicate destinations: if the shuffle script generates duplicate names (shouldn’t happen with padded sequential numbering), you’d see overwritten files. The scripts here prevent that by design.
  • Very large folders: copying thousands of photos can take time. Start with a smaller batch to validate the workflow.
  • Photos from iPhone in HEIC format: many workflows expect .HEIC. If your extension list only includes JPG/PNG, the shuffle will look “incomplete.”

Alternatives depending on your goal

Randomizing order is sometimes overkill. Here are alternatives that fit different targets.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If your goal is just a random slideshow

Use a slideshow tool that supports shuffle/play random mode. That avoids renaming and preserves original organization.

Best Value
WD 4TB My Passport, Portable External Hard Drive, Black, Backup Software with Defense Against ransomware, and Password Protection, USB 3.1/USB 3.0 Compatible - WDBPKJ0040BBK-WESN
  • Slim durable design to help take your important files with you
  • Vast capacities up to 6TB[1] to store your photos, videos, music, important documents and more
  • Back up smarter with included device management software[2] with defense against ransomware
  • Help secure your important files with password protection and hardware encryption
  • 3-year limited warranty

If you still need a shuffled export, do the shuffled copy once, then reuse that folder.

If your goal is a randomized batch for sharing

Create a shuffled folder (Windows/macOS methods) and share from that folder. Your OS file picker will follow filename sort in many apps.

If your goal is to keep the original filenames but shuffle viewing order

Create a shuffled index file (CSV) or playlist-like manifest, then feed it into an app that respects the manifest. This is more tool-dependent, but it avoids renaming entirely.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

FAQs

Can I randomize the order of photos in an existing folder without renaming?

Usually no. Most systems and apps sort folder contents by filename, timestamps, or metadata. Without renaming or an app-level shuffle feature, the order will remain effectively deterministic.

Will shuffling filenames break photo metadata like date taken?

In the methods above, you’re only copying or renaming files. EXIF metadata stays inside the image. If you use an app that rewrites metadata during export, that’s different—but these scripts don’t edit metadata.

How do I keep the shuffle from changing every time I run it?

True reproducibility requires a fixed random seed. The provided scripts use built-in randomness each run. If you want a repeatable shuffle, tell me your platform and I’ll provide a seed-based variant.

My folder has hundreds of photos—will this slow down my computer?

Copying thousands of files can take a while and uses disk I/O. Start with a small test folder first. Also ensure your destination has enough free space.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why aren’t some photos included after shuffling?

Most often it’s an extension filter mismatch (e.g., .HEIC files not included) or the folder contains subfolders (the scripts shown target files in the folder, not recursive subfolders).

Bottom Line

If you need random photo order that reliably works with most viewers, the most dependable approach is creating a shuffled copy with randomized filenames (then sorting by name during playback).

Use the Windows PowerShell or macOS Terminal scripts above as your go-to solutions for 2024—then adjust extension filters and test with a small batch before running on your full library.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.