How do you calculate the length of an SMS?

A normal SMS contains 160 characters with the GSM 7 bit alphabet

Characterset GSM 03.38 is standard for SMS and creates the GSM 7 bit alphabet.

According to wikipedia, the following characters are accepted.

0123456789

ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÑÜ

abcdefghijklmnopqrstuvwxyzäöñüà

èéùìòÇ'Øø'ÅåΔ_ΦΓΛΩΠΨΣΘΞ'ÆæßÉ

£$¥

.,!

"#¤%&'()*=-/:;<=>?¡'¿

Then there are some characters that will make the SMS longer, without converting it to Unicode, those are:

|^€{}[]~

When is it converted into Unicode?

When the message contains characters not avaliable in GSM 7 bit, it is converted into Unicode.

Different charsets could the be applied.

The most common one is GSM 8 bit.

There you will find greek letters and many latin characters (for example: š, ž, –, ´and “) that are not avaliable in the charset above. Emoticons/emojis belongs to the GSM 16 bit charset, this means that even more positions are used per character.

There are more Unicode formats that will take even more positions, but they are not very common and not listed here.

Messages sent as GSM 8 bit instead of GSM 7 bit can be maximum 70 characters per SMS instead of the usual 160 characters.

Concatenated messages will have max 153 characters in normal SMS and 67 characters in Unicode.

Max number of characters in a concatenated message is 1072 (16 SMS parts) providing it is GSM 8 bit Unicode.