Rotate a list

Rotate a list by N positions - items that fall off the front wrap to the back. Default Shift by is 1. Negative values rotate in the opposite direction. Same op as Shift elements with a simpler one-parameter interface.

Input
Ready
Output
Live

Rotate by N with wrap-around

Shift by N moves every line N positions forward; items that fall off the front wrap to the back. Negative N rotates in the opposite direction. `N % length` is applied first, so Shift by 7 on a 4-item list equals Shift by 3 - no wasted work, no out-of-range handling for you.

Duplicates, blank lines, and whitespace are preserved exactly. Rotation is a position transform, not a content transform - nothing is added, removed, or normalised. The output always has the same line count as the input.

Same op as Shift elements. This page is the one-parameter framing; use Shift elements when you want the direction + amount UI pair. Runs entirely in your browser.

How to use rotate a list

  1. 1Enter your list into the input panel
  2. 2Specify the number of positions to shift using the 'Shift by' option
  3. 3Observe the output panel updating with the rotated list
  4. 4Adjust the 'Shift by' value if needed to see different rotations
  5. 5Copy the rotated list from the output panel

Keyboard shortcuts

Drive ListShift without touching the mouse.

Shortcut Action
Ctrl ZUndo last input change
Ctrl Shift ZRedo
Ctrl Shift EnterToggle fullscreen focus on the editor
EscExit fullscreen
Ctrl KOpen the command palette to jump to any tool
Ctrl SSave current pipeline draft Plus
Ctrl PRun a saved pipeline Plus

What Rotate a List lets you do

Explore the various applications of this tool.

Reorganize task lists

Shift tasks in a list by a set number of positions to change their order of priority. Use the 'Shift by' option to specify how many places to move each item.

Change the starting item of an ordered list

Rotation lets you pick a different "head" without reordering the list. Useful for cycling through rankings, rotating on-call shifts, or advancing a queue.

Prepare data for analysis

Rotate columns of data to match specific analytical needs. This can help in aligning datasets for further processing.

Align schedule entries

Shift schedule entries to accommodate changes in meeting times or event sequences. Input your schedule and adjust the positions as needed.

Rotate a list for presentations

Change the order of presentation slides or points by rotating them. This helps in revising the flow of the presentation content.

Worked example

Example of rotating a list by 2 positions.

Input
Apple
Banana
Cherry
Date
Output
Cherry
Date
Apple
Banana

Settings reference

Understand how the 'Shift by' option affects the output using the example above.

Setting What it does Effect on the sample
Shift by: 2 Moves each item two positions forward Cherry and Date move to the top, Apple and Banana to the bottom

FAQ

How does the 'Shift by' option work?
The 'Shift by' option determines how many positions each list item moves forward. Enter any integer to adjust.
Can I rotate a list backwards?
Yes, use a negative number in the 'Shift by' option to rotate the list backwards.
What happens if I shift by a number larger than the list length?
The list will wrap around, effectively rotating as if using the remainder of the division by the list length.
Can I rotate multiple lists at once?
Currently, the tool supports rotating one list at a time. For batch processing, repeat the operation for each list.