Skip to content
TextArray
100% local

Rotate lines

Shift the order of your lines by a fixed amount, wrapping around from top to bottom.

Input
Output

Rotate lines

Rotating lines rearranges the order of your text by moving the first N lines to the end (up) or the last N lines to the start (down). Paste any text, choose how many lines to shift and which direction, and the result appears instantly.

When you rotate "up" by one position, the first line moves to the end and all others shift up. Rotating the list "apple, banana, cherry, date" up by 2 gives "cherry, date, apple, banana". Rotating "down" does the opposite: the last line moves to the start. The amount automatically wraps if it exceeds your line count, so rotating up by 5 on a 3-line list is the same as rotating up by 2.

All line breaks, spaces, and punctuation are preserved exactly. Your lines are rearranged, not modified. This runs entirely in your browser, so your text never leaves your device and is always private. Use it to reorganize lists, rotate through options, or simply play with the order of your data. Copy the result, download it as a text file, or send it to another tool when done.

FAQ

What does rotating up mean?
Rotating up by N moves the first N lines to the end. All other lines shift up to fill the gap. So rotating "a, b, c, d" up by 1 gives "b, c, d, a".
What is the difference between up and down?
Up moves the first N lines to the end. Down moves the last N lines to the front. Rotating "a, b, c, d" up by 1 gives "b, c, d, a", while down by 1 gives "d, a, b, c".
What happens if the amount is larger than the number of lines?
The amount wraps around using modulo. Rotating a 3-line list up by 5 is the same as rotating up by 2, since 5 mod 3 = 2.
Is my text uploaded anywhere?
No. The rotation runs entirely in your browser and your text never leaves your device.