Skip to content

How do you reverse a text?

Reverse the order of the letters, the words or the lines.

Transformation

Your text stays in this browser and is never saved or placed in links.

Transformed text

!dlrow ,olleH

Whitespace stays in its original slots in word mode; punctuation travels with its word. A final newline is an empty final line in line mode.

Reverse the order of the letters, the words or the lines.

How to use

  1. Type or paste your text into the box.
  2. Choose how to change it; the result updates as you type.
  3. Copy the result with the Copy button.

How it works

Letters reverses Unicode grapheme clusters with Intl.Segmenter, keeping emoji sequences and combining marks intact. Words reverses whitespace-delimited tokens while keeping whitespace slots. Lines reverses line contents while preserving separator slots. https://tc39.es/ecma402/#segmenter-objects

Whitespace stays in its original slots in word mode; punctuation travels with its word. A final newline is an empty final line in line mode.

Worked example

Worked example: Hello, world!

  1. Letters mode reverses every character, so "Hello, world!" becomes "!dlrow ,olleH".
  2. Words mode would instead give "world! Hello,", keeping each word as written.
  3. Lines mode leaves a one-line text as it is and reverses the order of several lines.

!dlrow ,olleH

Method

No outside data is used: the tool works only with what you enter, in your browser.

Sources and methods

Frequently asked questions

What do the three reverse modes do?

Letters reverses every character: "Hello, world!" becomes "!dlrow ,olleH". Words keeps each word but reverses their order: "world! Hello,". Lines reverses the order of the lines and keeps each line as it is.

Does reversing break emoji and accents?

No. Letters are reversed as whole characters, so emoji sequences like a family emoji and letters with combining accents stay intact instead of falling apart.

Is my text sent anywhere?

Text stays in this browser and is never saved or placed in links.

How much text can I enter?

Up to 20,000 UTF-16 units; some emoji use more than one unit.

How can I check whether a phrase is a palindrome?

Reverse it by letters and compare: if the result equals the original, ignoring case, spaces and punctuation, it is a palindrome. The palindrome checker does this for you.

Send feedback