Count SMS characters, detect GSM-7 vs UCS-2 encoding, and see how many message segments you'll be billed for. Useful when sending via Twilio, Vonage, MessageBird, AWS SNS, or any carrier-routed SMS.
An SMS is delivered in one or more segments of 140 bytes each. The encoding decides how many characters fit in those bytes:
| Encoding | Single segment | Multi-part segment | When used |
|---|---|---|---|
| GSM-7 | 160 chars | 153 chars | Plain Latin + the GSM 03.38 alphabet |
| UCS-2 | 70 chars | 67 chars | Any non-GSM character (emoji, CJK, accents) |
GSM-7 extension chars (^ { } \ [ ] ~ | € and form-feed) take two 7-bit positions instead of one.
Multi-part SMS reserves 6 bytes per segment for a UDH header used to reassemble the message — that's why the per-segment cap drops from 160→153 (GSM-7) and 70→67 (UCS-2).
A single non-GSM char (one emoji 😀, one curly quote ", one accented á that isn't in GSM) flips the entire message to UCS-2 and shrinks your cap to 70 chars per segment.