Twilio SMS Segment Calculator – GSM-7 / UCS-2 & Cost

A developer-focused SMS segment calculator that mirrors how Twilio splits and bills messages. Paste your message body to see the encoding Twilio will pick (GSM-7 or UCS-2), the exact segment count, the per-segment character limit, which characters are forcing Unicode, and an estimated campaign cost from your price per segment and recipient count. A Smart Encoding toggle previews the segment count after Twilio's automatic character substitutions. Everything runs locally in your browser — your message is never sent to Twilio or stored.

🔒 Runs entirely in your browser — your message body is never sent to Twilio or stored.

Type or paste exactly what you'll send. A single non-GSM character switches the whole message to UCS-2.
Previews the segment count after Twilio's automatic substitutions (curly quotes → straight, em dashes → hyphens, non-breaking spaces → spaces, ellipsis → three dots).
Encoding
Characters0
Segments billed0
Limit per segment160
Used in last segment0
GSM-7 extended chars (count ×2)0
$
Default: Twilio's US long-code list price — check your account's rate. US carriers add a per-segment surcharge on top.
Estimated send cost
$0.0000
segments × price per segment × recipients
These characters forced UCS-2 (Unicode):
Replace or remove them to fall back to GSM-7 and roughly double the per-segment capacity.

How Twilio splits a message into segments

When you send an SMS through Twilio, the message body is encoded before it leaves the platform. If every character belongs to the GSM-7 alphabet, Twilio uses GSM-7 and fits 160 characters in a single segment. The moment one character falls outside that alphabet — an emoji, a curly quote pasted from a word processor, an em dash, or many accented letters — Twilio switches the entire message to UCS-2, where a single segment holds only 70 characters.

Longer messages are sent as concatenated SMS: each part reserves a 6-byte User Data Header so the recipient's phone can stitch them back together in order. That overhead is why multi-segment limits are 153 (GSM-7) and 67 (UCS-2) rather than the full 160 and 70. Because Twilio bills per segment, a stray Unicode character can quietly multiply your cost — the offender list above exists so you can catch it before it ships.

Twilio's official segment calculator shows the same GSM-7/UCS-2 segmentation; this page adds a cost estimate, campaign totals across recipients, a Smart Encoding preview, and the exact characters to swap so a message stays in GSM-7.

Need a non-developer view, or want to clean problem characters? Try the SMS length calculator for a marketing-focused breakdown, or the safe emoji for SMS/MMS tool to pick characters that survive every carrier.

Reading num_segments from the Twilio API

After a send, Twilio reports how many segments it actually billed on the Message resource. In Node.js:

const msg = await client.messages.create({ to, from, body });
console.log(msg.numSegments); // "3" — note: a string, not a number

The Python equivalent is message.num_segments — also returned as a string, so cast it before doing math on it. For inbound messages, the same value arrives on your webhook as the NumSegments POST parameter.

If the value Twilio reports is higher than you expected, paste the exact body into the calculator above — the usual culprits are a pasted curly quote or invisible character from Word or Google Docs, which the offender list will flag.

Frequently Asked Questions

Twilio picks an encoding for your message body — GSM-7 for plain text, UCS-2 when any character isn't in the GSM-7 alphabet. A single-segment message fits 160 GSM-7 characters or 70 UCS-2 characters. Once you cross that, Twilio concatenates segments and each one carries a 6-byte UDH header, dropping the per-segment limit to 153 (GSM-7) or 67 (UCS-2). Every segment is billed as one outbound message.

Anything outside the GSM 03.38 alphabet — emoji, curly “smart” quotes, em dashes, most accented letters beyond the GSM set, and many symbols. This calculator lists the exact offending characters so you can swap them (e.g. replace a curly quote with a straight one) and drop back to GSM-7, which more than doubles the per-segment capacity.

Twilio's optional Smart Encoding automatically replaces common Unicode look-alikes (curly quotes, long dashes, non-breaking spaces) with GSM-7 equivalents before sending. By default this calculator shows the raw body — the worst case if Smart Encoding is off. Tick “Simulate Twilio Smart Encoding” under the message box to preview the segment count after those substitutions are applied, and how many segments they save.

Concatenated (multi-part) SMS reserve a 6-byte User Data Header (UDH) in each segment so the receiving phone can reassemble the parts in order. That header consumes 7 GSM-7 septets or 3 UCS-2 characters, leaving 153 GSM-7 or 67 UCS-2 characters of usable body per segment.

Twilio bills per segment, not per message. A 320-character GSM-7 message is 3 segments and costs roughly 3× a single SMS; the same text with one emoji becomes UCS-2 and can jump to 5 segments. Enter your price per segment above to estimate the send cost before you wire it into code.

It uses the same GSM-7 / UCS-2 rules and UDH overhead Twilio applies, counting UCS-2 by UTF-16 code units (so an emoji counts as two) and packing segments character by character — a two-septet extended character never straddles a segment boundary, matching Twilio's behaviour even in those edge cases. If Smart Encoding is enabled on your messaging service, compare against the toggle's result instead of the raw count.

This tool calculates SMS text segmentation. MMS is billed as a single message regardless of body length (and carries media), so segment math doesn't apply — if your content is short text, SMS segments are what determine cost.

No. The calculator runs entirely in your browser with no network calls — nothing is sent to Twilio, logged, or stored. You can safely paste production message bodies, including ones with customer data.

They belong to the GSM 03.38 extended table, which is transmitted as an escape septet plus the character — so each costs 2 of your 160 (or 153) septets. That is exactly what the “GSM-7 extended chars (count ×2)” row above is counting. If one of them lands where only a single septet remains in a segment, it starts the next segment instead.

The Twilio API caps a message body at 1,600 characters. In practice that means up to 11 GSM-7 segments (153 usable characters each after the UDH header — paste a max-length body above to see it) or up to 24 UCS-2 segments from a single API call. Anything longer is rejected with error 21617, so split it into separate messages yourself.