Skip to contentSkip to the inputSkip to the result

Reverse or repeat text

Reverse text or repeat it

Loading tool

Instructions

Reverse or repeat text

How to use

  1. Enter text and choose a mode.
  2. For repeating, set the count, what goes between copies (or type your own) and whether to number them.

Supported input

  • Up to 200,000 characters.
  • Repeat 1–1,000 times, up to 500,000 characters.
  • Emoji and combined characters stay whole.

Input example

abc 123

Result example

321 cba

Troubleshooting

  • Nothing is produced for empty input.
  • Split very long text into parts.

Limitations

  • Does not change the display direction of right-to-left scripts.

How it works

  • Reverses the order of characters, words or lines, or the letters inside each word, or repeats the same text.

Reversing text without breaking characters, and repeating it

What it is used for

  • Checking palindromes: “never odd or even” reversed is “neve ro ddo reven”, the same letters once spaces are ignored.
  • Fixing a list written surname last: reversing word order turns “Gildong Hong” into “Hong Gildong”.
  • Reading a chat export or log that runs oldest first from the newest line down.
  • Making placeholders or test data: NULL repeated four times with “, ” between gives “NULL, NULL, NULL, NULL”.
  • Writing practice sheets: a sentence repeated three times with numbers and new lines gives “1. …”, “2. …”, “3. …”.

It reverses what you see, not the bytes

Text is stored in smaller pieces than the characters on screen. The family emoji 👨‍👩‍👧 is three people and two joiners, the flag 🇰🇷 is the regional letters K and R, and an é typed with a combining accent is e plus the accent. Reverse those pieces naively and the family becomes 👧‍👩‍👨, a different emoji with the members reordered; the flag becomes R then K, which is no country and shows as two letters; and the accent drops off to the front of the word.

This tool first splits each line into user-perceived characters as Unicode UAX #29 defines them, using the browser’s Intl.Segmenter, and then reverses that sequence. “👨‍👩‍👧 family 🇰🇷” becomes “🇰🇷 ylimaf 👨‍👩‍👧”, and Café becomes éfaC with the accent still on its letter. Code that reverses a JavaScript string with split('').reverse() is worse still: it splits emoji into broken halves.

The four reversals side by side

Input: two lines, “Hello world 123” and “second line here” with two spaces after second.

  • Reverse characters: “321 dlrow olleH” and “ereh enil dnoces”. Each line is reversed on its own.
  • Reverse letters in each word: “olleH dlrow 321”. Words keep their places; only their letters turn round.
  • Reverse word order: “123 world Hello” and “here line second”. The runs of spaces move with the words, so the double space survives.
  • Reverse line order: the second line moves to the top; nothing inside the lines changes.

How long a repeat may be

The output length is counted as (text length + separator length) × count, plus 6 characters per copy reserved for numbering when numbers are on, and it must stay at or under 500,000 characters. A 999-character text repeated 500 times with new lines fits exactly; a 1,000-character text with new lines would need 1,001 × 500 = 500,500 and is refused, while the same text with no separator fits.

In a custom separator, \n is a new line and \t a tab: “---” repeated twice with \n=\n between gives three lines, ---, = and ---.

Right-to-left scripts

Arabic and Hebrew are stored in reading order and drawn right to left by the Unicode Bidirectional Algorithm (UAX #9). The tool reverses the stored order and leaves direction alone, so reversed Arabic is a different string whose letters take different joined shapes, and mixed with English it can be hard to tell which end is which on screen.

Checked

Frequently asked questions

What does reversing word order do?

It reverses the order of the space-separated words within each line. 'I like green tea' becomes 'tea green like I'; the letters in each word and the order of the lines stay the same.

Does reversing characters also flip the order of the lines?

No. Each line is reversed on its own, so the first line stays first. To turn the lines upside down, choose Reverse line order.

Why does repeating stop working at a high count?

(Text length + separator length) × count must stay at or under 500,000 characters, with 6 more characters per copy when numbering is on. So a 1,000-character text can be repeated 500 times with no separator, but 499 times with the default new line between copies. A 100-character text can go to the maximum of 1,000.