Text Reverser
Reverse any text by characters, words, each line, or line order — grapheme-safe, entirely on this device.
Press ? for shortcuts
Do it offline:$ rev file.txt
How to use it
- Paste your text, or drop a .txt file onto the input — it is read and reversed entirely on this device.
- Choose what to reverse: the characters, the word order, each line's characters, or the line order. The output updates as you type.
- Read the reversed result beside your input, with a live count of the characters, words or lines processed.
- Copy the reversed text, save it to a .txt file, or turn the current setup into a share link once you are sure it exposes nothing private.
Turn any text back-to-front without it leaving your machine. Reverse the whole character sequence, the word order, each line's characters, or the order of the lines. Every mode only rearranges what you already typed — no character becomes a look-alike glyph, so emoji, flags and accents survive exactly as typed.
How it works
Character reversal walks the text as grapheme clusters rather than raw code units. The browser's Intl.Segmenter gathers each user-perceived character — a letter with its combining accents, a surrogate pair for an astral symbol, a two-part regional-indicator flag, or a family emoji joined by zero-width joiners — into one unit before the order is turned around. Reversing UTF-16 code units directly would tear those into mojibake and orphaned halves.
The four modes differ only in which unit they reorder. Characters reverses the whole grapheme sequence; each line's characters does the same one line at a time; line order keeps each line's text but reverses their sequence. Word order reverses only the words and drops them into the untouched spacing skeleton, so your tabs, doubled spaces and blank lines stay put.
Examples
HelloolleHRead as five graphemes and emitted in the opposite order — the plainest case, one cluster per letter.
the quick brown foxfox brown quick theOnly the words trade places; the letters inside each word keep facing forward, unlike character mode.
abc
defcba
fedEach line is reversed on its own while the newline stays put, so both lines hold their top-to-bottom position.
first
second
thirdthird
second
firstThe lines are dealt out bottom to top while each line's own text is left untouched.
a👨👩👧👦𝕏𝕏👨👩👧👦aThe family emoji is four people joined by zero-width joiners and the double-struck X is a single astral code point; each stays one grapheme, so both survive the reversal intact while the a travels from front to back.
Every example on this page is executed against the same engine that powers the tool, on every build.
Gotchas worth knowing
Character mode moves your line breaks
Character mode treats a line break as one more character to move, so in multi-line text it no longer sits between the same two lines. Use each-line mode to hold the lines in place and turn only their contents around.
Grapheme clusters stay whole
Emoji, regional-indicator flags, skin-tone modifiers, ZWJ family sequences, a letter plus its combining accent (é is e followed by U+0301), and surrogate pairs each count as one character. The grapheme axes reverse those units, never the code units inside them, so nothing is split or orphaned.
Word mode preserves your spacing
Word order reverses the words and leaves the gaps exactly as they are — single spaces, runs of spaces, tabs and blank lines all stay put, and the line endings are never rewritten.
Mixed line endings are unified
When the line modes meet a mix of CRLF, LF and bare CR they rejoin with whichever ending is most common — a tie goes to the first seen — and a chip names the winner. A final line break is kept if the input had one; the grapheme and word axes leave endings alone.
Reversing is not mirroring
This tool reorders the characters you already have; it does not remap them to upside-down or mirror look-alikes. For right-to-left scripts such as Arabic or Hebrew it reverses the logical code-point order and makes no attempt to reshape the display; drawing stays the job of your browser and fonts.
Common errors
Line endings were mixed — output uses LF throughout.- The line modes normalize the endings for a consistent output; the chip records which ending won and shows only when more than one kind was present.
Input is larger than the 1 MB limit for this tool. For bigger payloads use the CLI: rev file.txt- This is a typed refusal, not a truncation — under the cap the tool reverses everything, over it nothing. The named command reverses each line of a file from your terminal.
This looks like a binary file, not text — choose a text file instead.- Dropped files are checked for NUL bytes before anything is read; a file that looks binary is refused and your current input is left exactly as it was.
FAQ
Will my emoji and accented characters survive being reversed?
Yes. Character and each-line modes gather every emoji, flag, skin-tone sequence and accented letter into one grapheme cluster before reordering, so they come back whole instead of broken into stray code points.
How is this different from upside-down or mirror text?
Those effects swap each letter for a look-alike glyph from another Unicode block, so the characters themselves change. Reversing keeps every original character and changes only the order, so the output is always a rearrangement of exactly what you pasted.
Does my text stay on this device?
It does. The reversal runs in your browser tab and nothing you paste is uploaded. A share link keeps the tool state in the URL fragment — the part after the # that browsers hold back from network requests — so a shared link reaches no server either.
Keyboard shortcuts
- ⌘/Ctrl + Enter
- Reverse the current input again.
- ⌘/Ctrl + S
- Save the reversed text as a .txt file.
- ⌘/Ctrl + C
- Copy the whole output when no text is selected; a selection copies as usual.
- ⌘/Ctrl + Shift + C
- Copy the whole output even when something is selected.
- t
- Switch to the next colour theme.
- ? or ⌘/Ctrl + /
- Open this keyboard-shortcut help dialog.
- Esc
- Close the open dialog; your input is never cleared.