Shift elements in a list

Shift items in a list left (first → last) or right (last → first) by N positions. The list wraps around, so items falling off one end reappear at the other - nothing is lost. Default: shift left by 1. Related: Rotate a list is the same operation with a different framing.

Input
Ready
Output
Live

Shift Elements in a List with Precision

Shifts every item by a given number of positions, wrapping around both ends so nothing is lost. Left shifts move the first items to the back; right shifts move the last items to the front.

Duplicates and blank lines are preserved in place; their relative order is kept intact across the shift.

Everything runs in your browser - no upload, no sign-up.

How to use shift elements in a list

  1. 1Select the direction from the 'Direction' option
  2. 2Enter the number of positions to shift in the 'By' field
  3. 3Observe the live output as you type
  4. 4Copy the result when satisfied
  5. 5Hit Download to save as a plain text file

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 shift elements lets you do

Explore the potential of shifting list items.

Reorder task lists

Use 'Shift Elements' to reorder tasks in a to-do list. Set the 'Direction' to move tasks up or down the list.

Organize shopping lists

Shift items in your shopping list to prioritize purchases. Adjust the 'By' value to customize the order.

Adjust playlist sequences

Modify the order of songs in a playlist by shifting their positions. This tool makes it easy to experiment with different sequences.

Manage project stages

Shift project stages in a list to reflect changing priorities. Select the direction to move stages forward or backward.

Fine-tune study schedules

Reorder study sessions in a schedule to optimize learning. Use the 'Shift Elements' feature to adjust as needed.

Worked example

An example of shifting elements in a simple task list.

Input
Task 1
Task 2
Task 3
Task 4
Output
Task 2
Task 3
Task 4
Task 1

Settings reference

Understand how each option affects the output using the example above.

Setting What it does Effect on the sample
Direction: right Shifts elements to the right Task 4 moves to the top
Direction: left Shifts elements to the left Task 1 moves to the end
By: 1 Shifts elements by one position Each task moves one step
By: 2 Shifts elements by two positions Each task moves two steps
Direction: left, By: 1 Combines settings to shift left by one Task 1 moves to the end

FAQ

How do I shift elements left?
Select 'left' in the 'Direction' option. The output updates as you type.
Can I shift elements by more than one position?
Yes, enter the desired number in the 'By' field to shift by multiple positions.
Does this tool support lists with duplicate items?
Yes, it handles duplicates without issues, maintaining their order relative to each other.
What happens if I shift elements beyond the list length?
The list wraps around, bringing elements from the end to the front as needed.