TransactionTree’s Text Message Character Limits & Concatenation Practices

What is the character limit for text messages?

The maximum number of characters per single message being sent to carriers depends on the encoding used, and the encoding used depends on the content of the message. The HTTP API limits SMS messages to a maximum length of 2048 characters.

  • A message containing text characters only will be encoded using GSM-7
  • A message containing emojis will be encoded using UCS-2

This table shows the maximum number of characters that can be sent in a single SMS segment to carriers.

Example MessageTypeCharacters used in example messageEncodingMax characters/ message(without UDH)
Hello - good afternoonTextGSM StandardGSM-7160
EmojiUnicodeUCS-270
信息UnicodeunicodeUSC-270

How does TransactionTree send concatenated (long) messages?

Depending on the message content (plain text, emojis, special characters etc), TransactionTree will use either GSM-7 or UCS-2 encoding to send the messages and each encoding has limitations to the number of characters that can be sent. The limitations for a single segment are:

  • 160 characters for GSM-7 (e.g. Latin-1/9 and GSM8)
  • 70 characters for UCS-2 (e.g. message with emojis)

When you send a message whose text is longer than the maximum number of characters per segment, TransactionTree will automatically split the message for you, add a special header (User Data Header), and send multiple SMS to carriers.

What is a User Data Header?

The User Data Header (UDH) takes up 6 bytes and instructs the receiving device how to reassemble the segments so that your whole message will be shown as one SMS on the receiving handset. The maximum number of characters per concatenated (long) message is slightly reduced due to the inclusion of concatenation headers (UDH).

Can you explain the math?

Yes! Here are some important units to start with:

  • SMS messages are sent in 140 bytes
  • 1 byte = 8 bits
  • In GSM encoding, 1 character = 7 bits
  • In Unicode, 1 character = 16 bits
  • UDH = 6 bytes

Now, let’s do some calculations.

Message TypeCalculationMax Characters per Segment
GSM Single Segment(140 bytes x 8 bits) / 7 bits160 characters
GSM Multi Segment((140 bytes - 6 bytes) x 8 bits) / 7 bits153 characters
Unicode Single Segment(140 bytes x 8 bits) / 16 bits70 characters
Unicode Multi Segment((140 bytes - 6 bytes) x 8 bits) / 16 bits67 characters

TransactionTree and the industry as a whole, counts messages by segments; therefore, customers will be charged for each individual message segment sent to downstream carriers.

For example:

Characters used in messageTotal number of charactersEncodingMessage SegmentsCalculation
Text Only160GSM-71No UDH required, all 160 characters are available
Text Only240GSM-72153+87=240 characters
Text and emojis150USS-2367+67+16=150 characters