Reverse Word Order
Reverse the order of words in each line of text.
Words: 0Characters: 0
Reverse word order vs. reverse text
This tool flips the order of words while keeping each word spelled normally — so The quick brown fox becomes fox brown quick The. (If you want each word spelled backwards instead, use a character reverser.) Spacing between words is preserved, and you can reverse each line independently or treat the whole text as one sequence. It all runs in your browser.
Built and maintained by Meet Shah · Last updated
What this tool is used for
- Reversing word order for a puzzle or a wordplay exercise.
- Checking a phrase palindrome by word rather than by character.
- Producing input to test a word-reversal implementation.
- Reordering a name written family-name-first.
- Creating a scrambled prompt where the words are intact but the order is not.
Frequently Asked Questions
- How does this differ from reversing text?
- The words keep their spelling and only their ORDER changes: 'hello world' becomes 'world hello', not 'dlrow olleh'. Character reversal is a separate operation with a different purpose.
- How are words identified?
- By whitespace boundaries, so punctuation stays attached to its word. 'Hello, world!' reverses to 'world! Hello,' — the comma travels with 'Hello', which looks wrong but is the honest result of splitting on spaces.
- What happens with multiple spaces?
- They are normally collapsed, since splitting on whitespace discards the runs. If the original spacing matters — aligned columns, for instance — the operation is lossy and should be done on a copy.
- Does it work with unspaced scripts?
- Not meaningfully. Chinese and Japanese do not separate words with spaces, so whitespace splitting sees the whole sentence as one token and reverses nothing. Proper handling needs dictionary segmentation.
- What is this used for?
- Reordering name formats (surname-first to given-name-first), reversing path segments, puzzle and CTF work, and testing that text-processing code handles word boundaries rather than assuming fixed positions.
- What happens to punctuation when the order reverses?
- It travels with the word it is attached to, so `Hello, world!` becomes `world! Hello,`. Re-punctuating the result is a separate normalisation step — this reorders tokens rather than rewriting a sentence.
- Is reversing words the same as reversing a string?
- No, and the difference matters for scripts. Reversing word ORDER is safe anywhere; reversing characters must operate on grapheme clusters, or an accented letter loses its combining mark and an emoji breaks into half a surrogate pair.
- What happens to punctuation attached to a word?
- It travels with the token, so reversing `Hello, world.` gives `world. Hello,` — the comma stays on the wrong word. Punctuation is part of the token unless it is stripped and reattached deliberately.
Common errors and gotchas
- Losing punctuation position, so a full stop ends up at the start of the line.
- Assuming words split on single spaces, which fails on irregular whitespace.
- Reversing across line boundaries when each line should be handled separately.
- Breaking a name convention rather than reordering it correctly, since not all names are two parts.
- Reversing text in a right-to-left script, where word order is already displayed differently.
Related Text Tools tools
Case Converter
Convert between Sentence, Title, camelCase, snake_case, and more.
Word Counter
Count words, characters, and analyze keyword density.
Text to Binary
Convert text into its 8-bit binary representation.
Binary to Text
Decode 8-bit binary back into readable text.
Text Reverser
Reverse text by characters, words, or lines.
Remove Duplicate Lines
Delete repeated lines and keep your list unique.
Remove Empty Lines
Strip blank and whitespace-only lines from text.
Sort Lines Alphabetically
Sort lines A–Z or Z–A, case-sensitive or not.