How many parts will my message require?

There are two factors that determine how many SMS parts a message will require to be sent: The number of characters in the message and which exact characters are sent. A good rule of thumb is 153 characters per part if the message can be written with a–zA–Z0–9 and basic punctuation. If not, count on 67 characters per part.

The 153/67 rule should be a good enough estimate for most people. If you're interested in the exact details of how messages are split across multiple SMS though, keep reading!

How big is an SMS?

A single SMS can store up to 140 bytes (1120 bits) of message data. Messages that are longer than 140 bytes will be split into multiple SMS parts. These ”concatenated” or ”multipart” SMS need to contain additional metadata that allows the handset to reassemble the entire message correctly, which is implemented in the form of a ”User Data Header” (UDH). The UDH is placed at the start of the message and is exactly 6 bytes (48 bits) long, leaving 134 bytes for the message itself.

In summary:

GSM 03.38

The standard encoding for SMS messages is the GSM 7-bit default alphabet, which is a 7-bit encoding for the GSM 03.38 basic character set. A single GSM 7-bit encoded SMS can therefore contain 1120 / 7 = 160 characters (153 characters if the SMS is multipart).

The GSM 03.38 basic character set is, as the name implies, a basic character set that contains the characters a–zA–Z0–9, essential punctuation such as .,!?, a handful of foreign characters and currency symbols. Notably, the € symbol is missing – the Euro didn't exist when the standard was adopted.

UTF-16

If your message contains data outside of the GSM 03.38 basic character set it will be automatically be encoded as UTF-16 (actually UTF-16BE, which is just UTF-16 with predetermined big-endianness). UTF-16 is a Unicode encoding that encodes all characters with one or two 16 bit ”code units” — basically, every character uses either 16 or 32 bits. This is a lot more than the 7 bits required for the GSM 03.38 encoding but it supports ”all” characters – Arabic, Chinese, Korean, Japanese, even emojis.

A single UTF-16 encoded SMS can hold between 35 and 70 characters. Multipart SMS can hold between 33 and 67 characters. For reasons beyond the scope of this article, messages written in almost any modern langauge will be able to use the entire 70/67 character limit.

Automatic message splitting

Luckily, you don't really have to worry about all of this since the 46elks API handles all message splitting and encoding automatically. The only way it affects you as an API consumer is in cost. We bill you (and get billed ourselves) for every message part sent, which means that you can potentially save a bit of money by being careful with what characters your message contains.

The aim of the game here is to avoid having your message unnecessarily encoded as UTF-16, which more than halves the number of characters you can send per SMS part. You do this by staying inside the GSM 03.38 character set. Here are some common hacks we recommend to our customers:

Of course, there's nothing wrong with using dashes instead of hyphens if proper punctuation is important to you!

Checking the actual cost of a message

If you're interested in knowing the exact cost of a message (without actually sending it) we have a dryrun flag that you can pass to POST /SMS. The SMS won't be sent to the carriers and you won't be charged but will receive the estimated cost in the API response:


          

You can also use our GSM analyser to get a visual representation of how different characters is affecting your messages. If you are logged in when using the tool you will have more options, for example the dryrun feature

More info