Reverse text

Reverse text flips your input character by character so the last character comes first and the first comes last. Paste hello and get olleh. Turn on Per Line to reverse each line independently instead of treating the whole text as one string. Looking for case flips instead? See invert case.

Input
Line 1:1 LF cloud_done Saved locally
Result Reverse Text
0 lines 0 chars

Literal character reversal

Reverse text walks the input from the last character to the first and joins the result back into a single string. hello becomes olleh. The transform is purely positional: case stays as-typed, diacritics stay attached to their base letter, punctuation moves with the rest of the characters. For a case flip without reordering, see invert case.

JavaScript reverses by UTF-16 code unit, which is fine for ASCII and most Latin text. Surrogate-paired emoji and astral-plane symbols (anything outside the Basic Multilingual Plane) reverse by their two code units, which can split a single emoji into garbage. If your input is plain prose or code, reversal is round-trip safe; if it contains emoji like flags or skin-toned faces, expect those characters to break.

Per Line changes the unit of reversal. With it off (the default), the whole input is one string and line breaks themselves get reordered, so a two-line block reverses end-of-second-line first. With it on, the input is split on \r?\n, each line is reversed independently, and the lines are rejoined in their original order. Use per-line when you want each row of a list flipped without scrambling the row order.

How to use reverse text

  1. 1Paste or type your text into the input panel on the left.
  2. 2The reversed result appears in the output panel on the right as you type.
  3. 3Toggle Per Line in the action bar if you want each line reversed independently instead of the whole block.
  4. 4Click Copy in the output header to copy the result.
  5. 5Click Download to save the result as a plain-text file.

Keyboard shortcuts

Drive TextResult without touching the mouse.

Shortcut Action
Ctrl FOpen the find & replace panel inside the input Plus
Ctrl ZUndo the last input change
Ctrl Shift ZRedo
Ctrl Shift EnterToggle fullscreen focus on the editor Plus
EscClose find & replace, or exit fullscreen
Ctrl KOpen the command palette to jump to any tool Plus
Ctrl SSave current workflow draft Plus
Ctrl PRun a saved workflow Plus

What this tool actually does

Whole-buffer reversal (default)

With Per Line off, the engine runs s.split("").reverse().join(""). Every character (including newlines, spaces, and punctuation) flips position. line one\nline two becomes owt enil\neno enil (note the line break itself moves).

Per Line mode

When the toggle is on, the engine splits on \r?\n, reverses each segment, and rejoins with \n. Lines stay in their original order, but every line's contents are mirrored. Useful for reversing list rows or columns without scrambling the layout.

Diacritics travel with their base letter

A precomposed accented character like é (U+00E9) is one code unit and reverses cleanly. Decomposed sequences (e + combining acute) split: the combining mark drifts onto a different base letter. If you need that to round-trip, run the input through Unicode Normalisation Form C first.

Emoji caveat

Surrogate-paired emoji and zero-width-joiner sequences (skin tones, country flags) reverse by code unit, not by grapheme, and tend to break. Reverse plain text is fine; reverse emoji-heavy text at your own risk. The statistics tool can show how many characters versus graphemes you have if you want to check first.

Round-trip safe for prose and code

For ASCII and most Latin / Cyrillic / Greek text, reversing twice returns the original. reverse(reverse(x)) === x. Use that property to confirm the tool is doing what you expect.

Worked example

With Per Line off, the entire buffer is reversed including the newline, so the second line appears first in the output. Turn on Per Line and the result becomes dlrow olleh\nxof nworb kciuq eht.

Input
hello world
the quick brown fox
Output
xof nworb kciuq eht
dlrow olleh

Settings reference

Setting Effect on output
Per Line Off (default): the whole input is reversed as one string; line breaks themselves move. On: each line is reversed independently and lines stay in original order.
Letters Reverse position. Case stays as-typed.
Digits and punctuation Reverse position with the rest of the text.
Whitespace Reverses with the rest of the text. In default mode, line endings move; in per-line mode, line endings are split off and rejoined.
Combining marks Reverse by code unit, which can split decomposed sequences. Run Unicode normalisation first if needed.
Surrogate-paired emoji Reverse by code unit and may break. Plain-text input is fine.

FAQ

How do I reverse each line on its own?
Turn on Per Line in the action bar. The engine then splits on \r?\n, reverses each line, and rejoins with the original newlines. Useful when you have a list and want each row flipped without the rows themselves getting shuffled.
Will my emoji survive reversal?
Single-code-unit emoji (most ASCII-style) survive. Surrogate-paired emoji (flags, skin-toned faces, ZWJ sequences) reverse by code unit and tend to break. If your input is emoji-heavy, expect garbage; for plain prose and code, reversal is safe.
Does this reverse word order or character order?
Character order. hello world becomes dlrow olleh, not world hello. To flip word order while keeping each word readable, paste the text, run reverse, then run reverse again with Per Line on after splitting words yourself.
Is the output sent anywhere?
No. The transform runs entirely in your browser via JavaScript. Nothing is uploaded, nothing is logged.
How do I undo a reverse?
Run reverse again on the output. The transform is its own inverse for any plain-text input, so a second pass returns the original characters.