DevTools Logo

Reverse Text

Reverse Text

Reverse characters, words or lines β€” emoji-safe with grapheme-aware segmentation.

Runs in your browser
Try an example

Original text

Reversed text

No reversed text yet

Type text above or load the emoji demo.

Reverse Text uses Intl.Segmenter to flip grapheme clusters rather than raw UTF-16 code units, so family emoji, flags and combining accents survive the operation. Choose characters, word order or line order, or chain any combination. Line endings are detected and preserved, word-mode spacing is normalized, and live statistics show graphemes, code points and UTF-16 units so you can see why naive reversal breaks emoji.

Examples

Emoji safety

Input
πŸ‘¨β€πŸ‘©β€πŸ‘§ family πŸ‡«πŸ‡·πŸ‡©πŸ‡ͺ
Output
πŸ‡©πŸ‡ͺπŸ‡«πŸ‡· ylimaf πŸ‘¨β€πŸ‘©β€πŸ‘§

Each emoji is one grapheme even though it uses several code points.

Word reversal

Input
one two three
Output
three two one

Word tokens are flipped while multiple spaces collapse to one.

Line reversal

Input
first
second
Output
second
first

The dominant CRLF ending is reused on join.

Why counts differ

Input
πŸ‘¨β€πŸ‘©β€πŸ‘§
Output
1 grapheme Β· 3 code points Β· 6 UTF-16 units

A naΓ―ve split on UTF-16 units would produce three broken pieces.

About this tool

Reverse Text flips text by characters, words or lines. Character mode uses Intl.Segmenter at grapheme granularity, so combining marks, ZWJ sequences such as πŸ‘¨β€πŸ‘©β€πŸ‘§ and regional-indicator flags such as πŸ‡«πŸ‡· stay intact. The tool also displays code-point and UTF-16 unit counts to explain why naive reversal corrupts emoji.

Word mode reverses token order and normalizes separators to single spaces; line mode reverses lines and preserves the dominant line ending, including CRLF. Chain mode lets you combine character reversal, word reversal and line reversal in one pass, which is useful for stylistic effects and for testing Unicode handling.

Everything runs locally in your browser. Input is live, the emoji demo is one click away, and output can be copied or downloaded as text.

What this tool does not do

  • Grapheme segmentation depends on Intl.Segmenter; older browsers fall back to code-point splitting and show a reduced-safety warning.
  • Word mode collapses all separators to single spaces and may not suit poetry or code formatting.
  • Line mode normalizes mixed endings to the dominant style rather than preserving each original ending.
  • The hard input cap is 2 MB with a soft warning above 200k characters.
  • The tool reverses logical text order; it does not perform visual mirroring or bidi rendering changes.

How to use this tool

  1. Type or paste text

    The reversed result updates as you type; nothing is uploaded.

  2. Pick a mode

    Characters for grapheme-safe mirror text, Words for token order, Lines for line order.

  3. Chain if needed

    Enable chaining to combine character, word and line reversals in a single operation.

  4. Inspect stats and export

    Compare graphemes with UTF-16 units, then copy or download the result.

Use cases

Stylized profile text

Create mirrored text for bios and social posts without breaking emoji.

Unicode testing

Check that an app handles grapheme clusters correctly with known-safe inputs.

Puzzle creation

Flip word or line order for riddles and word games.

Writing experiments

Explore stylistic effects of reversed sentence order.

Modes and chaining

ModeResult for a b c
Characters (graphemes)c b a β€” each visible character stays whole
Wordsc b a β€” word order flips, spaces normalized
LinesLast line first β€” dominant ending preserved
Chain: characters in linesEach line mirrored individually
Chain: word orderWords flipped inside each line
Chain: line orderLines flipped after other transformations

Chained transformations compose in the order line order β†’ words β†’ characters.

Common mistakes

Mistake:Reversing with text.split('').reverse().join('').

Fix:That splits UTF-16 code units and breaks emoji and combining marks; use grapheme segmentation.

Mistake:Expecting multiple spaces to survive word mode.

Fix:Word mode normalizes separators to single spaces by design.

Mistake:Assuming reversed RTL text will look mirrored on screen.

Fix:The tool reverses logical order; visual shaping and bidi layout remain the font and renderer's job.

Mistake:Forgetting that line mode normalizes endings.

Fix:The dominant ending (CRLF, LF or CR) is reused for every joined line.

Mistake:Pasting very large text.

Fix:Input above 200k characters triggers a soft warning and 2 MB is the hard cap.

Frequently asked questions

Why do other tools break emoji when reversing?

JavaScript strings are UTF-16. Splitting on code units cuts surrogate pairs and ZWJ sequences apart. This tool uses Intl.Segmenter at grapheme granularity, so πŸ‘¨β€πŸ‘©β€πŸ‘§ and πŸ‡«πŸ‡· remain single units.

What is a grapheme versus a character?

A grapheme is what a reader perceives as one character. It may be several code points β€” a base letter plus a combining accent, or several emoji joined by zero-width joiners. The stats panel shows graphemes, code points and UTF-16 units side by side.

Can I reverse only the word order?

Yes. Choose Word mode to flip tokens while keeping their contents intact. Multiple spaces are normalized to single spaces in that mode.

Does reversing text affect SEO or accessibility?

Reversed text remains ordinary text to search engines and screen readers; it gains no SEO benefit and can reduce readability. Use it for decoration or testing, not for hidden keyword tricks.

How does it handle right-to-left text like Arabic?

It reverses the logical order of graphemes. Visual shaping and bidirectional layout are handled by fonts and the browser, so the displayed result may not look like a simple mirror image.

Is my text uploaded?

No. Segmentation, reversal and statistics all run in your browser. Nothing is uploaded or stored.

References & standards