Skip to content
SMSRay

Segments & encoding

You are billed per segment. The encoding your text needs decides how many characters fit in each one — try it below.

Segment counter

Type a message to see how SMSRay will encode and split it. This uses the same rules as the API.

Try
Encoding
GSM-7
Segments
1 / 6
Length
79 septets
Left
81 of 160

Extension characters such as { } [ ] ~ ^ | \ € count as 2 septets each.

GSM-7

If every character is in the GSM 03.38 basic or extension table, the message uses GSM-7: 160 characters fit in one segment. That covers English letters, digits, common punctuation and a few accented letters.

Extension characters cost two septets each, because they are sent as an escape plus the character:

^{}\[]~|€form feed

UCS-2 and Nepali

A single character outside GSM-7 switches the whole message to UCS-2, where 70 UTF-16 code units fit in one segment. Devanagari is never GSM-7, so Nepali text is always UCS-2. Emoji and other characters outside the Basic Multilingual Plane cost two code units each.

Look out for

Curly quotes (“ ” ‘ ’), en and em dashes, and non-breaking spaces pasted from documents silently switch a message to UCS-2 and can double its cost.

Long messages

Longer messages are split into parts that the phone joins back together. Each part loses a few characters to the joining header:

Characters per segment
EncodingSingle segmentPer segment when split6 segments (max)
GSM-7160153918 septets
UCS-27067402 code units

An escape pair (GSM-7) or a surrogate pair (UCS-2) is never split across two parts, so a part can end one unit short.

Limits and billing

  • A message may use at most 6 segments. Longer text returns 400 invalid_request.
  • Empty text is 0 segments and is rejected.
  • Cost is your workspace rate for the message type × segments, reserved at accept. The reply tells you segments, encoding and cost.
  • OTP messages are always one GSM-7 segment.

Keeping costs down

  • Keep transactional messages under 160 GSM-7 characters where you can.
  • Replace typographic quotes and dashes with plain ASCII before sending English text.
  • For Nepali messages, aim for 70 characters or fewer; every 67 more adds a segment.
  • Avoid emoji in transactional and OTP messages.