Lettering Sorting – Sort by Letters

Enter Word/Strings…

Get Sorted List…

Settings

How to Use Our Letter Sorting Tool

Our tool is simple to use to sort your letters in alphabetical or reverse order.

Just enter the letters you want to sort in the left textbox and copy and paste the result from the right textbox. You can choose the sort order under the “Settings” section.

Letter Sorter Settings

Our tool has two settings to customize your experience:

  • Sorting order: You can choose to sort letters from A to Z or Z to A.
  • Delimiter: If you want to separate your letters with something (a space, comma, backslash, etc.), you can type the delimiter into the textbox.

Sorting Strings in Coding Languages

Letter Sorting in Python

There are a few ways to sort a string in Python:

1. Use the built-in “sorted” function

The easiest way to sort a string in Python is by using the built-in “sorted” function which creates a list from the string and then sorts it alphabetically. We then need to join the string back together.
sorted_word = ''.join(sorted(word))
The main disadvantage of this code is that it sorts the string with all capital letters before lowercase letters.

2. Sort without regard to case

sorted_word = ''.join(sorted(word, key=str.lower))

Letter Sorting in JavaScript

Use the following code to sort a string in JavaScript.

word.split("").sort().join("")

Letter Sorting in Java

Use the following code to sort a string in Java.

char[] chars = word.toCharArray();
Arrays.sort(chars);
String sorted = new String(chars);

Letter Sorting in C++

Use the following code to sort a string in C++.

std::sort(word.begin(), word.end());

Capitalize My Title Copy