Skip to content

Reverse Words

Updated:

Reverse the order of words in any text. Enter a sentence or passage to get the same words in the opposite order.

Word Order Reversal Tool

Input Fields
If enabled, the result will update automatically when you change any value.

Reverse Words Formula

Formula
\[R=\operatorname{join}_{\text{single spaces}}\!\left(\operatorname{reverse}\!\left(\operatorname{split}_{\text{one or more whitespace characters}}\!\left(\operatorname{trim}(T)\right)\right)\right)\]

Where:

  • \(T\) — the text entered in the Text field.
  • \(R\) — the result shown in Reversed Text.

The tool removes whitespace at the beginning and end, splits the remaining text wherever it finds one or more whitespace characters, reverses the resulting pieces, and joins them with single spaces. It changes the order of those pieces, not the order of characters within them.

Reverse Words – Calculation Example

Example: use the default Text value, “WPCalc is awesome.” Its three words are reversed in order.

\[\text{WPCalc is awesome}\;\longrightarrow\;\text{awesome is WPCalc}\]

Result: Reversed Text is awesome is WPCalc.

How to use the Reverse Words calculator

  1. Enter or paste your sentence, paragraph, or other text into the Text field. The default value, WPCalc is awesome, is available if you want to try an example first.
  2. Run the calculator if needed, then read the output under Reversed Text.
  3. Use the copy option on the result if you want to paste the reversed text elsewhere. Check punctuation and line breaks before using it in a document.

You do not need to place exactly one space between words. The tool also recognizes tabs and line breaks as separators. The output, however, uses one ordinary space between each resulting piece of text.

What does reversing words mean?

Reversing words changes their sequence while leaving the characters within each whitespace-separated piece in their original order. For example, red green blue becomes blue green red. This differs from reversing letters, which changes the character order inside the text. If that is what you need, use the Reverse Letters calculator instead.

In this tool, a “word” is any uninterrupted run of non-whitespace characters. It does not identify words by grammar or language. Consequently, well-known stays together as one piece, and 123-45 stays together too. A punctuation mark attached to a word moves with that word: Hello, world! becomes world! Hello,. The result may therefore need punctuation edits before it reads like a conventional sentence.

Word reversal can help you inspect a sequence from the opposite end, rearrange a short phrase for a writing exercise, or reverse a space-separated set of labels. The output tells you the new order of the pieces, not whether the resulting sentence is grammatically correct. Capitalization is also unchanged, so a word that began a sentence may retain its capital letter after it moves to the end.

Whitespace and other practical limits

  • Extra spaces are not preserved. Leading and trailing whitespace is removed. Runs of spaces, tabs, or line breaks between pieces become single spaces in the output.
  • Line breaks do not define separate groups. The tool treats text across multiple lines as one sequence, reverses all its pieces, and returns them on one line. It does not reverse the words independently within each original line.
  • Punctuation remains attached. Quotes, commas, periods, and other marks do not move independently from the non-whitespace characters beside them. Review the result if punctuation placement matters.
  • Only word order changes. The tool does not translate, alphabetize, correct spelling, or standardize letter case. If the Text field contains only whitespace, Reversed Text is empty.

For a different kind of rearrangement, use Reverse List when list items, rather than whitespace-separated words, are the units you want to move. To sort items alphabetically instead of reversing their order, try List Alphabetizer. If you need to measure the length of either version of your text, the Character Counter provides a separate character count.

Frequently Asked Questions

How can I reverse the order of words by hand?

Write down each word in order, then copy them from the last word to the first. For “one two three four,” number the words 1 through 4 and copy them in the order 4, 3, 2, 1. Keep any punctuation attached to its word, then check whether the new sentence needs punctuation or capitalization edits.

Will reversing the same text twice give me the original?

It will restore the original word order, but not necessarily the exact original text. The first reversal replaces runs of whitespace with single spaces and removes whitespace at the beginning and end. Those formatting changes cannot be recovered by reversing the result again. For example, two spaces between words will remain one space.

Can I reverse the words on each line separately?

Yes, but you need to process each line separately. Paste the first line, copy its result, and repeat for the remaining lines. If you paste all the lines at once, their words form one sequence, so a word from the last line can become the first word of the output.

Does a non-breaking space separate words?

Yes. A non-breaking space is recognized as whitespace, so words on either side are separated and the output uses an ordinary space between them. A zero-width space, however, is generally not treated as a separator by this tool. If two words unexpectedly stay together, try replacing the character between them with a regular space.

Does Reverse Words work for languages that do not use spaces between words?

It can reverse separated pieces of text, but it does not detect linguistic word boundaries. In writing systems where words are commonly written without spaces, an entire uninterrupted passage may be treated as one piece and remain unchanged. Add spaces at the boundaries you want to use before reversing, then review the result.

How do I reverse comma-separated items instead of words?

Use a list-reversing tool if each comma-separated item should stay intact. This calculator splits at whitespace, not commas: “red,green,blue” is one piece and will not change, while “red, green, blue” becomes “blue green, red,” with commas still attached to their original pieces. For structured or multiword items, put each item on its own line in a list tool.

Leave a Reply

Your email address will not be published. Required fields are marked *

One thought on “Reverse Words”