Messaging · Encoding
GSM-7 vs UCS-2 character checker.
Paste text to see, character by character, its Unicode code point, UTF-8 bytes, UTF-16 units and whether it fits the GSM-7 SMS alphabet.
Inputs
Character table
Enter your details.
How to tell GSM-7 characters from UCS-2 ones
Text messages use one of two encodings. GSM-7 is a fixed alphabet of 128 positions (letters, digits, common punctuation, a few accented letters and symbols such as the pound and yen signs). Anything else, including emoji, curly quotes, en and em dashes, most accented capitals and every non-Latin script, needs UCS-2 and shrinks the limit from 160 to 70 characters.
Code points, bytes and units. A code point is the Unicode number of a character. UTF-8 stores it in 1 to 4 bytes (what push payloads and web APIs count); UTF-16 stores it in 1 or 2 units of 2 bytes (what UCS-2 SMS and many languages count). Characters above U+FFFF, such as most emoji, take two UTF-16 units, which is why one emoji uses two of the 70 places in a text.
Worked example. The euro sign is U+20AC: 3 UTF-8 bytes, 1 UTF-16 unit, and in SMS it is a GSM-7 extension character that counts as two. The party popper U+1F389 is 4 UTF-8 bytes, 2 UTF-16 units and forces UCS-2.
Frequently asked questions
Which characters are in the GSM-7 alphabet?
The 128-position default alphabet includes A-Z, a-z, 0-9, common punctuation, and symbols such as @, the pound, dollar, yen and section signs, plus a handful of accented letters. Twilio publishes the full map, and the checker above classifies every character you paste.
Why do curly quotes and dashes break GSM-7?
The GSM-7 alphabet has the straight quotation mark and the hyphen-minus but not the curly quotes, the en dash or the em dash. Word processors insert those automatically, which silently switches a message to UCS-2.
What are GSM-7 extension characters?
The extension table adds | ^ euro { } [ ~ ] and backslash. They are sent as an escape code plus the character, so each uses two places in the 160-character limit.
How many bytes is an emoji?
Most emoji are 4 bytes in UTF-8 and two 16-bit units in UTF-16. Emoji made of several code points, such as flags or skin tones, are longer.
Does this tool upload my text?
No. Everything is computed in your browser.
Sources
Checked
- Twilio: What is GSM-7 character encoding?
- Twilio: How long can a message be?
- 3GPP TS 23.038: Alphabets and language-specific information
Twilio publishes the GSM-7 map and the rule that one non-GSM-7 character switches the message to UCS-2; 3GPP TS 23.038 defines the extension table. Byte and unit counts are standard UTF-8 and UTF-16 arithmetic. National-language shift tables used by some carriers are not modelled. Runs entirely in your browser.
Scope
Encoding classification follows the default GSM-7 alphabet. Some carriers support national language shift tables that this tool does not model.