Skip to content
ToolsUnlocked

Reverse Words

This tool will reverse words in a sentence: it flips the order of the words so the last word comes first, while each word stays readable. You can also reverse the letters inside each word, or do both, and choose whether each line is handled on its own or the whole text as one. Punctuation can stay attached to its word.

Runs in your browser Free, no sign-up
Reverse Words

How to reverse words in a sentence

  1. 1 Type or paste your text into the left box, open a .txt file, or press Try an example.
  2. 2 Choose what to reverse: the order of the words, the letters in each word, or both, and whether to apply it to each line or the whole text.
  3. 3 The result appears on the right straight away and updates as you type.
  4. 4 Press Copy result or Download .txt, or Use as input to keep editing.

Reversing words or reversing text

Reversing words keeps each word readable and changes their order. To flip every character, use Reverse Text; to test whether text reads the same backwards, use the Palindrome Checker.

  • Keep punctuation attached for tidy results.
  • Reverse line by line for lists.
  • Reverse twice to get the original back.

Features

Three modes

Word order, letters in each word, or both.

Line by line

Reverse each line separately or the whole text.

Tidy punctuation

Keeps commas and full stops with their words.

When to use it

Puzzles and games

Create reversed sentences for word puzzles and classroom activities. To check palindromes, use the Palindrome Checker.

Programming practice

Check expected output for the classic reverse-words coding exercise.

Lists in reverse

Turn a comma list or a sentence around quickly. To reverse the order of lines instead, use the Reverse current order option in Sort Lines Alphabetically.

Fun messages

Send a playful backwards sentence to friends. For mirror-style backwards text, use Reverse Text.

Related Text tasks

Frequently asked questions

What is the difference between reversing words and reversing text?

Reversing words changes their order, so hello world becomes world hello. Reversing text flips every character, so it becomes dlrow olleh. Use Reverse Text for the second.

What does reversing the letters in each word do?

Each word is spelled backwards but stays in its place, so hello world becomes olleh dlrow.

What happens to punctuation?

With the option on, punctuation stays at the end or start of its word, so world! reversed is dlrow!, not !dlrow.

Can I reverse a whole paragraph?

Choose Apply to the whole text as one, and all the words are reversed together, ignoring line breaks.

Are spaces kept?

The spacing between words is kept as closely as possible, and each line stays on its own line when reversing line by line.

Does it work with other languages?

Yes, for languages that separate words with spaces. Languages written without spaces, such as Chinese, are treated as one word.

Can I undo it?

Reverse the result again with the same settings to get the original back, or keep your original text in the left box.

How is reversing words used in programming interviews?

Reversing the words of a sentence is a classic exercise that tests splitting strings, handling spaces and joining results. Use this tool to check the expected answer for your own test sentences.

Does it reverse the order of lines too?

No. Each line stays in its place and only the words within it are reversed. To flip the order of lines, use the Reverse current order option in Sort Lines Alphabetically.

Is my text private?

Yes. Everything happens in your browser and nothing is sent anywhere.

How this tool works. These text tools run entirely in your browser with plain JavaScript, so the text you paste never leaves your device and results update as you type. Each tool is tested with real text such as copied PDFs, emails, code, lists, emojis and non-English scripts before it goes live.

HF

Built and reviewed by , founder and lead developer
Last updated · How we check our tools · Report a problem