String Reverser / Rotator
Reverse a string or rotate it by n characters.
About String Reverser / Rotator
A string reverser flips text so the last character comes first; the rotator moves a chosen number of characters from the start of the text to the end instead.
How to use
- Choose Reverse or Rotate with the switch at the top of the panel.
- Type or paste the text. The output updates as you type and has a Copy button.
- In Rotate mode, set Rotate by: a whole number from −100 to 100. Positive moves characters from the start to the end; negative moves them from the end to the start.
What it does
- Reversal works on Unicode code points, so emoji and accented characters stay intact rather than splitting into broken bytes. Combining marks (an accent typed as a separate character) will still move away from their base letter.
- Rotation wraps around: rotating a 5-character string by 7 is the same as rotating by 2.
- Line breaks and spaces are ordinary characters and are reversed or rotated with everything else.
- Only whole strings are handled; there is no word-by-word or line-by-line reversal.
Example
hello world → reverse → dlrow olleh
hello world → rotate 3 → lo worldhel
Privacy
Runs in the browser. No request is made, and nothing is stored.
Frequently asked questions
- How do I reverse a string in JavaScript?
- Use [...str].reverse().join(""). Spreading into an array splits on code points, so emoji survive; str.split("").reverse().join("") splits on UTF-16 units and corrupts characters outside the Basic Multilingual Plane.
- What does rotating a string mean?
- A rotation (or circular shift) moves characters off one end and back onto the other, so "abcdef" rotated left by 2 is "cdefab". The length never changes, and rotating by the string length gives the original back.
- Why does reversed text with emoji sometimes look wrong?
- Some emoji are several code points joined by zero-width joiners (a family or a flag, for example). Reversing the code points reverses those sequences too, which can turn one emoji into several.