Reverse Text — Characters, Words, or Lines

Six reverse modes — character, grapheme-aware, word order, line order, and per-line variants — with a built-in palindrome detector. 100% in your browser.

What is a reverse text tool?

A reverse text tool flips the order of the characters, words, or lines in a piece of text. The OpenFormatter version offers six modes — character, grapheme-aware, word, line, words-per-line, and chars-per-line — plus a built-in palindrome detector. Choose the mode that matches the granularity you actually need.

Character reverse uses Array.from to keep surrogate-pair emoji intact. The grapheme mode goes further, using Intl.Segmenter to keep zero-width-joiner sequences (compound emoji, flags, family glyphs) together. All processing runs locally — text never leaves your browser.

How to reverse text — 4 steps

  1. Paste your text. Drop any text — a sentence, a paragraph, a list — into the input panel.
  2. Pick a reverse mode. Six options cover everything from full character flip to per-line word reversal.
  3. Read the output. The right panel updates instantly. A palindrome badge appears when the input reads the same forward and backward.
  4. Copy the result. One-click copy sends the reversed text to your clipboard.

Sample input and output

Input: "The quick brown fox"

Reverse characters     → "xof nworb kciuq ehT"
Reverse word order     → "fox brown quick The"
Reverse line order     → (single line, unchanged)
Reverse chars per line → "xof nworb kciuq ehT"
Reverse words per line → "fox brown quick The"

Input: "A man a plan a canal Panama"
Palindrome detector    → ✓ Palindrome (ignores case and punctuation)

The palindrome check folds case and strips non-alphanumerics before comparing — the standard convention used in puzzle and interview palindrome problems.

Six Reverse Modes

Character, grapheme-aware, word, line, words-per-line, and chars-per-line — pick the granularity you actually need.

Emoji Safe

Character mode preserves surrogate pairs; grapheme mode keeps ZWJ sequences (👨‍👩‍👧, 🏳️‍🌈) intact.

Palindrome Detector

Live badge tells you whether the input reads the same forward and backward, ignoring case and punctuation.

Client-Side Only

Every reverse mode runs in JavaScript on your device. Drafts and confidential text never reach a server.

Common use cases

  • check_circleTesting palindromes for puzzles, riddles, and interview prep
  • check_circleGenerating reversed strings for unique IDs or hash inputs
  • check_circleDebugging right-to-left rendering issues by viewing logical order
  • check_circleCreating obfuscated text for educational demos and CTF challenges
  • check_circleReformatting parts of timestamps or paths by reversing components
  • check_circleReversing line order to inspect log files chronologically (oldest first)
  • check_circleProducing eye-catching backwards captions for social media
  • check_circleQuickly checking that the last words of a paragraph make sense (word reverse)

Reverse mode comparison

ModeInputOutput
CharactersHello worlddlrow olleH
GraphemesHi 👨‍👩‍👧👨‍👩‍👧 iH
Word orderHello worldworld Hello
Line ordera\nb\ncc\nb\na
Words per linea b\nc db a\nd c
Chars per lineabc\ndefcba\nfed

More text utilities

Sort, count, change case, or diff text — every tool runs in your browser.

Frequently Asked Questions

What is the difference between reversing characters and reversing words?

Character reverse flips every character, so "Hello world" becomes "dlrow olleH". Word reverse keeps each word forward but swaps the word order, so "Hello world" becomes "world Hello". Choose the one that matches what you actually need — character reverse is great for puzzles and palindromes; word reverse is more useful for reformatting sentences.

Why does the tool offer a "graphemes" reverse mode?

Plain character reverse flips every code unit, which can break compound emoji that use zero-width joiners (👨‍👩‍👧 = 5 code points). Grapheme-aware reverse uses Intl.Segmenter to identify what humans perceive as one character — emoji families, flag sequences, accented letters with combining marks — and keeps each grapheme intact when reversing.

How does the palindrome detector work?

The detector lowercases the input, strips everything that is not a letter or digit, then checks whether the result reads the same forward and backward. So "A man, a plan, a canal: Panama!" is detected as a palindrome because the normalised string ("amanaplanacanalpanama") is symmetrical. The check appears under the result whenever the input is non-empty.

Why does emoji reverse sometimes produce odd glyphs?

Two reasons. First, plain character reverse splits surrogate pairs (the higher and lower halves of a 4-byte emoji). The OpenFormatter character reverse uses Array.from to keep surrogate pairs together, so single-codepoint emoji always stay intact. Second, ZWJ sequences (👨‍👩‍👧) are several joined code points; only the grapheme-aware mode keeps these clusters together.

Can I reverse a multi-line text without breaking line content?

Yes — use "Reverse line order". Lines come out last-first while each line's content stays the same. Use "Reverse words per line" or "Reverse chars per line" if you want to apply the reversal inside each line independently instead of globally.

What are real uses for reversing text?

Common use cases include: testing palindromes for puzzles or interview prep, generating reversed strings for unique IDs or hash inputs, debugging right-to-left rendering issues, creating obfuscated text for educational demos, reformatting timestamps from "DD-MM-YYYY" to "YYYY-MM-DD" by reversing parts, and producing inverted file paths for tree visualisations.

Is the text uploaded?

No. Every reverse mode runs in JavaScript inside your browser. Open DevTools → Network and confirm: zero requests on every keystroke. Safe for any text you cannot paste into a remote tool.

Does reversing reverse RTL text correctly?

Logical reversal is performed on the underlying code points or graphemes — what gets stored, not what gets rendered. RTL scripts (Arabic, Hebrew) display right-to-left by the bidi algorithm regardless of storage order, so a "reversed" Arabic string is rendered in the opposite logical sequence. For most use cases this is the intended behaviour; for RTL-correct visual reversal you usually want a different transformation.

Reverse Text Online — Free Character & Word Order Reverser