Segment calculator
Use this interactive tool to check how your message will be encoded and segmented:How segments work
Every SMS message is transmitted in units of 140 bytes. When a message exceeds one segment, a 6-byte header (User Data Header, or UDH) is added to each segment for reassembly, reducing the usable space.Segment calculation formula
To calculate the number of segments for a message:- GSM-7
- UTF-16
Cost impact example
Consider a 200-character message:Encoding by sender type
GSM 7-bit character set
Telnyx uses a GSM 7-bit encoding optimized for maximum carrier compatibility. Only characters in this set will keep your message in the efficient GSM-7 encoding.Standard characters (1 character each)
Standard characters (1 character each)
Extended characters (2 characters each)
Extended characters (2 characters each)
Detecting encoding in your application
Before sending, you can check if a message will use GSM-7 or UTF-16 encoding to estimate costs. Here are helper functions for each language:Common encoding issues
Message unexpectedly uses UTF-16 (too many segments)
Message unexpectedly uses UTF-16 (too many segments)
- Enable smart encoding to auto-replace these characters
- Or manually replace them with GSM-7 equivalents before sending
Emojis dramatically increase segment count
Emojis dramatically increase segment count
Extended GSM-7 characters cause unexpected segment splits
Extended GSM-7 characters cause unexpected segment splits
[, ], {, }, |, \, ^, ~, and € are in the GSM-7 extended set and count as 2 characters each.Example:Copy-pasted text from Word/Google Docs causes issues
Copy-pasted text from Word/Google Docs causes issues
- Enable smart encoding — this handles the most common substitutions automatically
- Sanitize text before sending by replacing known problem characters
- Use the
encodingparameter set togsm7to get a400error if non-GSM-7 characters are present (fail-fast approach)
Messages truncated or split incorrectly on recipient's phone
Messages truncated or split incorrectly on recipient's phone
- Keep messages under 3-4 segments for maximum compatibility
- Telnyx supports up to 10 segments, but recipient device support varies
- Consider using MMS for longer content
Non-Latin scripts (Chinese, Arabic, Cyrillic) use too many segments
Non-Latin scripts (Chinese, Arabic, Cyrillic) use too many segments
- This is expected behavior — plan for higher segment counts when messaging in non-Latin scripts
- Keep messages concise
- Consider MMS for longer non-Latin content
Best practices
Enable smart encoding
Validate before sending
Sanitize input text
Keep messages concise