DocsWebsitePricingSupportConsole
Guides

Encoding and length

How many characters fit in a part, and why one emoji can double the price.

An SMS part carries 140 bytes. Which characters you use decides how many fit: each message is sent in one of two encodings, chosen for the whole message.

EncodingOne partEach part of a longer messageLongest message (10 parts)
gsm7: GSM-7160 characters153 characters1,530 characters
ucs2: Unicode70 characters67 characters670 characters

Part of every longer message's space goes on the header that joins the parts again on the phone, hence 153 and 67. The response's encoding and segments say which applied and how many parts you were billed for.

GSM-7#

Used when every character is in the GSM alphabet: Latin letters A–Z and a–z, digits, common punctuation, and a few accented letters such as é è ù ì ò Ä Ö Ü ä ö ü ñ à. These count double, as they take an escape character:

^{}\[]~|€

Unicode (UCS-2)#

One character outside GSM-7 switches the whole message to Unicode, at 70 characters a part: Cyrillic, Greek lowercase, Arabic, Chinese, and also curly quotes “ ”, long dashes —, á í ó ú ç and emoji. Emoji and other characters outside the basic plane count as two.

TextEncodingParts
Your code is 482913GSM-71 (19 of 160)
Ваш код: 482913Unicode1 (15 of 70)
Hello 🙂Unicode1 (8 of 70: the emoji makes it Unicode, and counts as two)

Smart encoding#

Texts pasted from documents often carry typographic characters that look like plain ones. Send "smart_encoding": true and these are replaced before the encoding is chosen, so the message stays GSM-7:

ReplacedWith
‘ ’ ‚ ‛'
“ ” „ ‟ « »"
– — − •-
…...
Non-breaking and thin spacesA space
Zero-width spaces and byte-order marksRemoved

It doesn't change letters: a text in Cyrillic or with an emoji stays Unicode.

The console's Send page shows a text's parts and encoding as you type it.