Cyclically Shift Unicode
Rotate Unicode text left/right with grapheme-cluster awareness - ZWJ emoji, combining accents, Indic scripts handled correctly. Free, offline, client-side, instant, secure.
- Runs in your browser
- Nothing uploaded
- Free, no sign-up
Rotate text left or right with grapheme-cluster awareness. Code-point splitting tears ZWJ emoji and combining accents apart; grapheme clustering keeps them whole. Uses Intl.Segmenter with a code-point fallback for older browsers.
How to Use Cyclically Shift Unicode
- Pick segmentation mode: Grapheme clusters (default) treats user-perceived characters as units -
🏳️🌈= 1,café= 4. Code points splits at Unicode code points (single-emoji = 1, but ZWJ sequences split). UTF-16 code units uses raw.charAt(surrogates separate). - Enter or paste your text, or click Load sample to see how the modes differ.
- Set positions (any integer; modular wrap if larger than length). Negative inverts direction.
- Pick direction: left moves first N units to the end; right moves last N to start.
- Live preview updates after 100 ms. Ctrl+Enter triggers manually.
- Copy or download
shifted.txt.
Frequently Asked Questions
Grapheme vs code point vs code unit – which?
Grapheme cluster (default): a “user-perceived character”. `🏳️🌈` = 1, `café` = 4. Use for human-readable rotations. Code point: a single Unicode value (0-0x10FFFF). `🌍` = 1, `🏳️🌈` = 4, `café` = 4 or 5 (depends on NFC vs decomposed). Use when emulating other tools’ “characters” count. UTF-16 code unit: raw .charAt – surrogates separate. `🌍` = 2 (high surrogate + low surrogate), `café` = 4. Use only for matching JavaScript’s native .length and .charAt semantics.
What’s a ZWJ sequence?
Zero-Width Joiner (U+200D). It glues multiple emoji or characters into one rendered glyph. Examples: 👨👩👧👦 = `👨 + ZWJ + 👩 + ZWJ + 👧 + ZWJ + 👦`, 🏳️🌈 = `🏳 + VS16 (variation selector) + ZWJ + 🌈`, 👩🏽💻 = `👩 + skin-tone modifier + ZWJ + 💻`. Without grapheme awareness, these break apart on rotation. The Intl.Segmenter API knows the Unicode Standard’s grapheme breaking rules and keeps them together.
What’s a combining mark?
Characters that attach to the preceding base character. Examples: `é` can be `e + ◌́` (U+0301 combining acute accent – 2 code points) OR `é` (U+00E9 – 1 code point). Most modern text uses precomposed forms (NFC), but pasted-from-PDF or scientific notation often uses combining marks. Indic scripts (Devanagari, Tamil, Bengali) heavily use combining vowel marks – `कि` is `क` (consonant) + `ि` (vowel mark above it). Treating them as separate units would split the consonant from its vowel.
What’s “effective shift”?
After modular reduction. If your text has 10 graphemes and you shift by 23, the effective shift is `23 mod 10 = 3` – same as shifting by 3. The stats card shows the reduced value so you know what actually happened. Negative effective shift = direction was inverted (you entered a negative number with Left direction → effectively a Right shift).
How do I undo a shift?
Apply the inverse: a Left shift of N → undo with Right shift of N (or Left shift of `length – N`). Negative N inverts direction implicitly, so Left -3 = Right 3 for undo. The stats card’s effective shift makes this easy to compute.
Is this useful for cryptography?
No – cyclic shift is trivially reversible and offers zero cryptographic strength. It’s a permutation of the input, fully recoverable without a key. Caesar ciphers are a different concept (each character mapped to character N positions later in the alphabet, which is also trivial to break). For real encryption use AES; for toy ciphers, this tool is fine for puzzles and pedagogy.
What about RTL scripts (Arabic, Hebrew)?
Logical-order rotation: the bytes/code points are rotated regardless of display direction. Arabic shaping (initial/medial/final forms) is applied by the browser after rotation, so the displayed result may look different from what you’d expect if you were rotating “visually”. This is correct behavior – text storage is always logical-order in Unicode. If you want visual-order rotation, you’d have to reverse the text first.
Is my data secure?
Yes. Text never leaves your browser. Intl.Segmenter runs locally as part of the V8/JavaScriptCore/SpiderMonkey runtime. The shifted text + download are all generated in memory and offered locally.
Related Tools
Center Unicode Text →
Center Unicode text within a fixed width, with real grapheme counting for emoji and…
Check Spoofed Unicode Text →
Detect Unicode confusables and homoglyphs from Cyrillic, Greek, Armenian, and Hebrew that imitate Latin…
Chunkify Unicode Text →
Split Unicode text into equal chunks with grapheme, code-point, or UTF-16 modes. Keeps emoji…
ASCII to Unicode Converter →
ASCII to Unicode & Decode decimal, hex, octal, or U+XXXX values to Unicode characters…
Convert Code Points to Unicode →
Convert Code Points to Unicode (U+XXXX, hex, decimal) to characters - handles emoji, CJK,…
Convert Unicode to ASCII →
Convert Unicode to ASCII with transliteration (é → e, ñ → n), replace, or…
Convert Unicode to Base64 →
Encode Unicode text to Base64 (and decode) with standard, URL-safe, MIME variants. UTF-8 proper.…
Convert Unicode to Binary →
Convert Unicode to binary in 3 modes (UTF-8, codepoint, UTF-16). Per-character breakdown. Free, offline,…
Convert Unicode to Bytes →
Convert Unicode to UTF-8 bytes in hex, decimal, or binary. Per-byte grid, reverse direction.…
Convert Unicode to Code Points →
Convert Unicode to code points (U+XXXX, HTML/CSS/JS escapes) and back. Per-character breakdown. Free, offline,…
Convert Unicode to Data URL →
Convert Unicode to data URLs with base64 or URL-encoding, 12 MIME types, charset toggle.…
Convert Unicode to Decimal →
Convert Unicode text to decimal code point values.