Visible-on-first-run random rotation
The op is `1 + Math.floor(Math.random() * (length - 1))` - an integer N in the range `[1, length - 1]` inclusive. Zero is excluded on purpose so a fresh paint never produces an accidental no-op (which happens with `Math.floor(Math.random() * length)` about once every `length` runs).
Rotation itself is `all.slice(n).concat(all.slice(0, n))` - same mechanics as Rotate a list. This variant just picks the offset for you and always produces a visible shift.
Single-item lists pass through unchanged (the status bar says "single item - cannot rotate"). Empty input returns empty output. Otherwise every run produces a different rotation - no seed, no reproducibility.
How to use rotate a list randomly
- 1Paste your list into the input panel
- 2Output is your list rotated by a random non-zero offset
- 3Every run picks a new offset - output differs each time
- 4Single-item lists pass through unchanged
- 5For a chosen offset, use Rotate a list
Keyboard shortcuts
Drive ListShift without touching the mouse.
What this tool actually does
Random offset from `[1, length-1]`, rotate by that amount.
Non-zero offset by construction
The op picks from `[1, length - 1]` inclusive, never 0. This guarantees a visible shift on every paint - unlike `Math.random() * length` which hits 0 roughly once every `length` runs and produces a no-op.
Wrap-around rotation
Items falling off the front wrap to the back. With a 5-item list and offset 2, item at index 0 moves to index 3. No items are dropped or duplicated.
Different every run
No seed input. Each call to the op gets a fresh `Math.random()` and thus a fresh offset. Same input, different outputs.
Single-item and empty lists
A one-item list passes through unchanged (the status bar notes "single item - cannot rotate"). Empty input returns empty output.
Not cryptographically secure
`Math.random` is fine for raffles and general shuffling but not security-critical work. For cryptographically-secure rotation, use `crypto.getRandomValues` directly.
Worked example
Random rotation - one possible result shown. Output varies on every run.
apple banana cherry date elderberry
cherry date elderberry apple banana
Behavior reference
No user options. These are the fixed rules.
| Rule | What it does | Example |
|---|---|---|
| Offset range | Random integer in `[1, length - 1]` - excludes 0 | For a 5-item list: offset is 1, 2, 3, or 4 |
| Wrap-around | Items rotate; none dropped or duplicated | Offset 2 on `A B C D E` → `C D E A B` |
| Single-item list | Pass-through, status bar notes the no-op | `[A]` → `[A]` |
| Empty input | Empty output | (empty) |
| Non-reproducible | No seed; every run picks a new offset | Different output every click |