Get Reversed List…
Copy
List items: 0
Settings
(\n for line break, \t for tab)
How to Use Our List Reverser
Our free list reverser tool automatically reverses a list. Copy your list and watch the conversion happen.
Reverse a List
- Change any settings on the right side of the list reverser by selecting how you want the list to be modified.
- Delimiter: The delimiter is the value you want to separate items in your lists. You can choose from commas (the default), commas with spaces after, spaces, and others.
- Remove Line Breaks: This setting will remove any extra line breaks in case you have blank rows.
- Remove Paragraph Breaks: This setting removes paragraph breaks which are two two line breaks in a row.
- Remove Extra Spaces: If you have any issues with double spaces after removing lines, select this option.
- Paste your column or list of data into the left text box where it says “Enter List Here…”
- You’ll see the new delimited list in the right text box labeled “Get Reversed List…”
- It’s that simple. Copy and paste wherever.
- Note: If you paste a list in, the reversed list will be auto-copied to your clipboard.
How to Reverse a List in Excel
Using a Helper Column:
Suppose your list is in Column A, starting from cell A1.
- In Column B, starting from cell B1, enter the formula:
=INDEX($A$1:$A$10,COUNTA($A$1:$A$10)+1-ROW(A1)) - Drag the fill handle down to apply the formula to the rest of the cells in Column B.
- Column B will now contain the reversed list.
Using VBA:
- Press
Alt + F11to open the VBA editor. - Insert a new module (
Insert > Module) and paste the following code:
Sub ReverseList()
Dim LastRow As Long
Dim StartRow As Long
Dim EndRow As Long
Dim Temp As Variant
LastRow = Cells(Rows.Count, 1).End(xlUp).Row
StartRow = 1
EndRow = LastRow
While StartRow < EndRow
Temp = Cells(StartRow, 1).Value
Cells(StartRow, 1).Value = Cells(EndRow, 1).Value
Cells(EndRow, 1).Value = Temp
StartRow = StartRow + 1
EndRow = EndRow - 1
Wend
End Sub
- Close the VBA editor and run the macro to reverse the list.
How to Reverse a List in Python
Using reverse() Method:
my_list = [1, 2, 3, 4, 5]
my_list.reverse()
print(my_list) # Output: [5, 4, 3, 2, 1]
Using Slicing:
my_list = [1, 2, 3, 4, 5]
reversed_list = my_list[::-1]
print(reversed_list) # Output: [5, 4, 3, 2, 1]
Using reversed() Function:
my_list = [1, 2, 3, 4, 5]
reversed_list = list(reversed(my_list))
print(reversed_list) # Output: [5, 4, 3, 2, 1]
How to Reverse a List in JavaScript
Using reverse() Method:
let myArray = [1, 2, 3, 4, 5];
myArray.reverse();
console.log(myArray); // Output: [5, 4, 3, 2, 1]
Using a Custom Function:
function reverseArray(arr) {
let reversedArray = [];
for (let i = arr.length - 1; i >= 0; i--) {
reversedArray.push(arr[i]);
}
return reversedArray;
}
let myArray = [1, 2, 3, 4, 5];
console.log(reverseArray(myArray)); // Output: [5, 4, 3, 2, 1]
How to Reverse a List in Java
Using Collections.reverse():
import java.util.*;
public class ReverseList {
public static void main(String[] args) {
List<Integer> myList = Arrays.asList(1, 2, 3, 4, 5);
Collections.reverse(myList);
System.out.println(myList); // Output: [5, 4, 3, 2, 1]
}
}
Using a Custom Method:
import java.util.*;
public class ReverseList {
public static void main(String[] args) {
List<Integer> myList = Arrays.asList(1, 2, 3, 4, 5);
List<Integer> reversedList = new ArrayList<>();
for (int i = myList.size() - 1; i >= 0; i--) {
reversedList.add(myList.get(i));
}
System.out.println(reversedList); // Output: [5, 4, 3, 2, 1]
}
}
How to Reverse a List in C
#include <stdio.h>
void reverseArray(int arr[], int size) {
int start = 0;
int end = size - 1;
while (start < end) {
int temp = arr[start];
arr[start] = arr[end];
arr[end] = temp;
start++;
end--;
}
}
int main() {
int myArray[] = {1, 2, 3, 4, 5};
int size = sizeof(myArray) / sizeof(myArray[0]);
reverseArray(myArray, size);
printf("Reversed array: ");
for (int i = 0; i < size; i++) {
printf("%d ", myArray[i]);
}
// Output: 5 4 3 2 1
return 0;
}