Skip to content
Text Repeater
Back to the text repeater

Counting characters and emoji

Under the result, Text Repeater shows how many characters, words, and lines it contains. Here's how each count works, why another app might count the same text differently, and how to stay under a length limit.

Last updated

The three counts

Characters

Text Repeater counts characters the way you see them: if it looks like one character, it counts as one. That includes an accented letter such as Ć©, an emoji with a skin tone such as šŸ‘šŸ½, a flag such as šŸ‡ÆšŸ‡µ, and a family emoji such as šŸ‘Øā€šŸ‘©ā€šŸ‘§, even though most of these are stored as several pieces.

Spaces and line breaks count as characters too. For example, hi repeated 3 times with New line is 8 characters: six letters and two line breaks.

Technically, Text Repeater counts grapheme clusters, the Unicode name for what a reader sees as a single character. It finds them with your browser's built-in Intl.Segmenter. In very old browsers without it, Text Repeater counts Unicode code points instead, so an emoji with a skin tone or a flag counts as 2.

Words

A word is a group of characters separated by spaces, tabs, or line breaks, so hi hi hi is 3 words. Copies joined with None form one long word: hihihi is 1 word. In languages written without spaces between words, such as Chinese, Japanese, or Thai, each unbroken run of text counts as one word.

Lines

Lines is the number of line breaks plus one. hi repeated 3 times with New line is 3 lines. With \n\n as a custom separator, the blank lines between the copies count too, which makes 5. A long line that wraps on your screen still counts as one line, because wrapping doesn't add a line break.

Why other apps count differently

Text is stored as a sequence of Unicode code points: numbered characters such as U+0041 for the letter A. Many things you see as one character are built from several code points. A skin-tone emoji is a base emoji plus a skin-tone modifier, a flag is a pair of regional indicator letters, and a family emoji is several people joined by invisible zero-width joiners. Code points are in turn stored as code units or bytes, and different apps count different layers:

  • Graphemes are what you see. Text Repeater counts these.
  • Unicode code points count each numbered character once. Python's len() works this way, and so does Text Repeater in very old browsers.
  • UTF-16 code units are what JavaScript's string length and many web forms count. Most emoji take two units or more, which is why some apps count an emoji as 2 characters.
  • UTF-8 bytes are what some databases and APIs count. A code point takes 1 to 4 bytes, so a limit measured in bytes fills up fastest.

For basic English letters, digits, and punctuation, all four counts agree. They start to differ with accented letters, other scripts, and especially emoji. None of the numbers is wrong; they measure different things.

The same character, counted four ways

Every example below counts as 1 character in Text Repeater. The other columns show what an app that counts code points, UTF-16 code units, or UTF-8 bytes would report.

ExampleText RepeaterCode pointsUTF-16 unitsUTF-8 bytes
ACapital letter AU+00411111
ƩAccented e as one code pointU+00E91112
éPlain e plus a combining accentU+0065 U+03011223
ā¤ļøRed heart: heart symbol plus emoji style selectorU+2764 U+FE0F1226
šŸ˜‚Face with tears of joyU+1F6021124
šŸ‘šŸ½Thumbs up with medium skin toneU+1F44D U+1F3FD1248
šŸ‡ÆšŸ‡µFlag of Japan: regional indicators J and PU+1F1EF U+1F1F51248
šŸ‘Øā€šŸ‘©ā€šŸ‘§Family: man, woman, and girl joined by zero-width joinersU+1F468 U+200D U+1F469 U+200D U+1F46715818

The two Ć© rows look the same, but the second is a plain e followed by a separate accent mark. Text copied from some sources is stored that way, which is one reason an accented word can count as longer in another app.

If an emoji in the table shows up as two or more separate symbols, your device's emoji font doesn't have a combined image for it. Windows, for example, often shows flags as two letters. The code points are the same, and Text Repeater still counts one character.

How to stay under a length limit

Many apps limit how long a message, post, or form field can be, and some count an emoji as two characters or more. Limits vary and change, so check the app you're pasting into. Then:

  • Check the count. Look at Characters under the result before you copy.
  • Leave a margin. Aim a little under the limit, especially if your text has emoji or accented letters.
  • Allow extra for emoji. An emoji that counts as 1 here can count as 2, 4, or more elsewhere. šŸ˜‚ repeated 50 times with no separator, which is what the Emoji Repeater opens with, is 50 characters in Text Repeater but 100 UTF-16 code units.
  • Count the line breaks. Most apps count spaces and line breaks as characters, so 100 copies with New line include 99 extra characters for the line breaks.
  • Test it. Paste the result where it's going. If it's cut off or won't send, lower the repeat count.

Downloaded files are measured in bytes

Download .txt saves the result as a UTF-8 text file. In UTF-8, basic Latin letters, digits, and punctuation take 1 byte each, accented letters such as Ć© take 2, and most emoji take 4 bytes per code point. That's why the file's size in bytes can be larger than the character count: šŸ˜‚ repeated 50 times is 50 characters but 200 bytes, and a single family emoji takes 18 bytes.