All Tools

Unicode Text Tools: Grapheme-Aware Pad, Reverse, Zalgo

Pad, centre, chunk, shift, rotate, reverse, repeat, truncate, split, sort and count Unicode text by grapheme, so emoji, flags and accents stay whole. Add strikethrough marks, make Zalgo text or clean it. Nothing is uploaded.

Width

Widths count graphemes, so an emoji, a flag or an East Asian wide character counts as one.

0 characters, 0 bytes

0 characters, 0 bytes


About the Unicode text tools

This page applies one Unicode-aware operation to a whole text. Type or paste any text, including emoji, flags, accented letters and scripts from around the world, choose an operation and read the result, ready to copy or download as a .txt file. There are twenty operations: centre, left-pad, right-pad and right-align lines; chunk text into groups; shift letters within their alphabet; rotate, reverse, repeat and truncate; join lines; split text into characters or into equal fragments; sort graphemes; list the unique graphemes with their counts; count characters in six different units; and add, remove or pile up combining marks, including Zalgo text. Texts of up to 1,000,000 characters are accepted. Everything runs in your browser and nothing is uploaded.

Why graphemes and not characters

What a reader sees as one character is often several code points. The flag 🇩🇪 is two regional indicator symbols, the thumbs-up 👍🏽 is a base emoji plus a skin-tone modifier, the family emoji 👨‍👩‍👧 is three people joined by zero-width joiners, and é can be written as e followed by a combining acute accent. A naive tool that reverses or truncates code units breaks all of these into broken pieces and question marks.

Every operation here works on extended grapheme clusters, the user-perceived characters defined by Unicode Standard Annex #29 and found with the browser's built-in Intl.Segmenter. Reversing "ae👍🏽" gives "👍🏽ea" with the skin tone still attached, truncating never cuts an emoji in half, and a CRLF line break counts as a single grapheme.

Widths for padding and alignment are counted in graphemes too. An East Asian wide character such as 漢 counts as one, even though a monospaced font draws it twice as wide, so columns of mixed scripts may not line up perfectly on screen.

How to use the tools

Steps

  1. Pick an operation from the Operation list. Each one shows only the settings it needs.
  2. Type or paste your text. The output updates as you type.
  3. Adjust the settings. Separator fields accept \n for a line break and \t for a tab.
  4. Press Copy or Download .txt. For Zalgo text, press Generate again for a new random set of marks.

The operations

Pad and align

Centre and right-align trim each line and align it to the longest line or to a fixed width; centring puts any odd pad on the right. Left-pad and right-pad add a pad character, which may be any single grapheme including an emoji, until each line reaches the width. Lines that are already wider stay as they are.

Rearrange

Reverse works per line or on the whole text. Rotate moves graphemes from one end to the other, so "abc" rotated left by one is "bca". Shift letters moves each letter a number of places within its own alphabet, wrapping round: with 13 it is ROT13 for Latin, and Greek, Cyrillic, Armenian and Hebrew letters shift within their own alphabets, keeping accents. Repeat copies the text with a separator, truncate shortens each line or the whole text to a number of graphemes with an optional ellipsis, and sort orders the graphemes by code point or by language-aware collation, ascending or descending, optionally unique.

Split, join and inspect

Chunk cuts text into groups of n graphemes, split into characters lists each grapheme or each code point, split into fragments cuts the text into k nearly equal parts, and join lines glues lines together. Extract unique graphemes lists every distinct grapheme with its code points and count, and count characters reports graphemes, code points, UTF-16 code units, UTF-8 bytes, words and lines.

Combining marks

Add a combining mark places a strikethrough, underline, overline or slash mark after every character. Remove combining marks decomposes the text and strips every nonspacing and enclosing mark, so "Crème brûlée" becomes "Creme brulee", while emoji keycaps and selectors survive. Generate Zalgo text piles random marks above, through and below each letter, and remove Zalgo text cleans it again, keeping accents that form a real letter.

Related tools

To change upper and lower case, use the Text Case Converter. To see the bytes behind a text, use Text to Binary, and to tidy spaces and blank lines, use the Whitespace Remover. The Reverse Text tool offers word and line reversal as well.

Open-source credits

  • The Unicode text tools are implemented in-house for this site and use no third-party library.
  • Grapheme and word boundaries follow Unicode Standard Annex #29, Unicode Text Segmentation, through the browser's Intl.Segmenter, and the tests use cases from its rules GB3, GB9, GB11 and GB12.
  • Decomposition and recomposition follow Unicode Standard Annex #15, Normalization Forms, through String.prototype.normalize; language-aware sorting uses Intl.Collator, which implements the Unicode Collation Algorithm (UTS #10).
  • Zalgo marks are drawn from the Combining Diacritical Marks block (U+0300 to U+036F) of the Unicode Standard, with the browser's Web Crypto API as the random source.

Frequently asked questions

What is a grapheme, and why do the tools count graphemes?

A grapheme is what a reader sees as one character, even when it is built from several code points, such as a flag, an emoji with a skin tone or a letter with a combining accent. Counting graphemes means reversing, truncating or padding never splits such a character apart.

Why do the counts for graphemes, code points, UTF-16 units and UTF-8 bytes differ?

They measure different layers. A thumbs-up emoji with a skin tone is one grapheme made of two code points, stored as four UTF-16 code units in JavaScript strings and as eight bytes in UTF-8 files, so each limit you meet depends on which layer a system counts.

Why do columns padded here not always line up on screen?

Widths are counted in graphemes, so an East Asian wide character such as a kanji counts as one, while monospaced fonts usually draw it twice as wide as a Latin letter. Emoji widths also vary between fonts, so perfect alignment of mixed scripts cannot be promised.

How does shifting letters handle Greek, Cyrillic and accented letters?

Each letter moves only within its own alphabet and case: Latin A to Z, Greek alpha to omega, the 32 basic Cyrillic letters, and the Armenian and Hebrew alphabets, all wrapping round. An accented letter is decomposed first, so the base letter shifts while its accent stays on top.

Does removing Zalgo text also delete normal accents?

Not by default. A letter with a single accent is left alone, and from a stack of marks the cleaner keeps the leading ones that combine with the letter into one precomposed character, such as é or the Vietnamese ệ. Turning on Strip every accent removes those as well.

Is there a limit to how much text the tools accept?

The input may hold up to one million characters. Operations that make text longer, such as repeating, padding or Zalgo generation, also stop with a message before producing more than ten million characters, so a large setting cannot freeze the browser tab.

Other related tools