SMS Counter

  1. Home
  2. > Utility >
  3. SMS Counter

Count SMS characters, split preview parts, and detect the encoding used for the current text.

Encoding: 7bit SMS parts: 0 Chars used: 0 Chars in SMS: 160

Encoding preview

Message content missing

Legend

   -  Regular 7bit character, present in GSM charset
ESC  -  Escape character 0x1B; required to access |^{}[]~ extended 7bit characters
   -  User Defined Header (UDH) of the message. Required for multipart sms
   -  Character present in GSM charset, encoded as Unicode character
   -  Character not present in GSM charset, forces to use Unicode encoding

SMS Character Count: How to Calculate According to SMS Standard (RFC)

According to the SMS standard defined in the SMS RF (GSM 03.38), a single SMS message can contain up to 160 7-bit characters, or 70 16-bit characters, or 140 8-bit characters. To count the number of characters in an SMS according to this standard, you will need to determine the character encoding of the message and then use the appropriate formula to calculate the number of characters.

For example, if the message is encoded using 7-bit characters, you can count the number of characters by dividing the number of bytes in the message by 7.

If the message is longer than the maximum allowed by a single SMS, it is possible to send it as multiple SMS messages, known as multipart SMS. In this case, the message is divided into several parts and each part is sent as a separate SMS. To concatenate the parts of the message and to keep track of the message parts, a User Data Header (UDH) is added to each SMS.

When counting the number of characters in a multipart SMS with a UDH, you will need to take into account the characters used in the UDH in addition to the characters used in the message.

The number of characters in each part of the message can be calculated as:

if (message is 7-bit encoded) {
    characters_per_part = (140 - len(UDH)) * 8 / 7
} else if (message is 8-bit encoded) {
    characters_per_part = 140 - len(UDH)
} else if (message is 16-bit encoded){
    characters_per_part = (140 - len(UDH)) / 2
}

Note: The maximum number of characters per part may vary based on the UDH length.

If the multipart SMS contains characters not present in the GSM character set and with a UDH, the process is a bit more complex.

GSM 03.38 defines a limited character set that contains only 128 characters, but Unicode contains over 110,000 characters. So, when the message contains characters that are not present in the GSM character set, they need to be encoded using a technique called "character set extension" that uses two 7-bit characters to represent a single character not in the GSM character set.

To count the number of characters in a multipart SMS with a UDH that contains characters not present in the GSM character set, you will need to take into account the characters used in the UDH, the number of characters not present in the GSM character set and the number of characters present in the GSM character set.

The number of characters in each part of the message can be calculated as:

if (message is 7-bit encoded)
    characters_per_part = (140 - len(UDH) - (number of characters not present in GSM character set)) * 8 / 7
if (message is 8-bit encoded)
    characters_per_part = 140 - len(UDH) - (number of characters not present in GSM character set)

It's important to note that the above algorithm assumes that the message is properly encoded and the UDH is properly added to the message, also the character extension is properly applied, otherwise it may not provide an accurate count of the number of characters in the SMS.

How to Use This SMS Counter

Using this SMS character counter is quick and straightforward. Follow these steps:

  1. Type or paste your message — Enter your SMS text into the textarea. The counter updates instantly as you type.
  2. Check the badges — Four badges show the current status: Encoding (7bit or Unicode), SMS parts (number of segments), Chars used, and Chars in SMS (max per segment).
  3. Review the encoding preview — The colored preview below shows how your message is split into segments. Each part is color-coded according to the legend.
  4. Understand the legend — The legend explains the color coding: regular GSM 7-bit characters, escape sequences, UDH headers, Unicode characters, and characters outside the GSM charset.
  5. Avoid long messages — Keep your message within a single SMS part (160 GSM characters or 70 Unicode characters) to avoid multipart charges.

Frequently Asked Questions

What is the SMS character limit?

A single SMS message can contain up to 160 characters using GSM 7-bit encoding, or 70 characters using Unicode (16-bit) encoding. Once you exceed these limits, the message is split into multiple parts with a User Data Header (UDH), reducing the available characters per part to 153 for 7-bit and 67 for Unicode.

What is the difference between 7-bit and Unicode encoding?

GSM 7-bit uses the default GSM 03.38 alphabet with 128 characters (letters, numbers, and common symbols). It allows up to 160 characters per SMS. Unicode (UCS-2) is used when your message contains characters outside the GSM charset — such as emoji, certain accented letters, or special symbols — and reduces the limit to 70 characters per SMS.

How many characters fit in a multipart SMS?

When a message exceeds a single SMS segment, a User Data Header (UDH) of 6 bytes is added to each part. For 7-bit encoded multipart messages, each part holds 153 characters. For Unicode multipart messages, each part holds 67 characters. This tool automatically calculates these limits for you.

Why does my message switch to Unicode encoding?

Your message switches to Unicode encoding when it contains one or more characters that are not part of the GSM 03.38 default alphabet. Common examples include emoji (😊), curly quotes (""), dashes (), and accented characters like é or ü. Once Unicode is triggered, the entire message uses 16-bit encoding.

What are SMS parts and how are they charged?

SMS parts (also called segments) are the individual messages your phone sends when the text exceeds the single-SMS limit. Most mobile carriers charge per part, not per message. For example, a 200-character message in GSM 7-bit is split into 2 parts (153 + 47), and you may be billed for 2 SMS messages. This tool helps you avoid unexpected charges by showing the exact number of parts.

Help2Code Logo
Menu