Everyone knows that a text message holds 160 characters. Fewer people know that the number is a result of arithmetic, that it holds only for some kinds of text, and that a single curly apostrophe or one emoji can cut it to 70. A message that looks like one text can also be sent as two or three, and each part is usually billed as a message of its own. The rules are old and strict, and they are the reason that a campaign that was priced for one segment can cost twice as much on the day it is sent.
This guide explains where the numbers come from and how to keep a message inside the limit. It draws on the Wikipedia article on the GSM 03.38 alphabet, on 3GPP TS 23.038, the standard that defines the alphabets, and on the documentation of Twilio, Telnyx, and AWS End User Messaging, all linked at the end. It also uses the tests that were run for the SMS counter on this site, which was compared with two independent libraries on more than 750 texts.
The short answer: a text message carries 140 bytes. The characters you use decide how many fit in them, and a message that does not fit in one piece is cut into pieces that each carry a little less.
Where 160 comes from
A single SMS has room for 140 bytes of text data. If the text is written in the GSM 7-bit default alphabet, each character takes 7 bits instead of 8, so 140 bytes of 8 bits make 1,120 bits, and 1,120 divided by 7 is 160 characters. Twilio's documentation shows the same sum: 140 bytes times 8 bits, divided by 7 bits, is 160 characters.
Wikipedia describes the same limit from the other side. A message can have up to 160 characters, packed in up to 140 octets, in one SMS in the GSM network. The number looks like a design choice, and it is really a product of the size of the message and the size of a character. Change either and the number changes.
What the GSM alphabet contains
The alphabet is defined in 3GPP TS 23.038. It has 127 characters that you can type: the English letters and digits, the usual punctuation, a few currency signs, some accented letters such as é, è, ü, ñ, and ß, and the capital Greek letters Δ, Φ, Γ, Λ, Ω, Π, Ψ, Σ, Θ, and Ξ. Many letters you might expect are missing. The lowercase ç is not there, and neither are á, í, ó, ú, â, ê, or ô. French, Spanish, and Portuguese text therefore falls out of the alphabet more often than people expect.
A character that is not in the alphabet cannot be sent in 7 bits. The sender has to use a different encoding for the whole message, and that is where 70 comes from.
Why one character changes the whole message
The other encoding is UCS-2, a Unicode encoding in which each character takes 16 bits. In 140 bytes, only 70 fit. Wikipedia says that a single SMS using this encoding can have at most 70 characters, and that when a character outside the GSM alphabet is used, the whole message is encoded again in UCS-2, so that the maximum for one SMS is immediately reduced from 160 to 70.
Twilio's documentation says the same: if any character is not in GSM-7, the message body falls back to UCS-2, which limits each message body to 70 characters. The change applies to the whole message and not only to the odd character. One emoji in a message of about 100 characters makes it a Unicode message, which needs two segments instead of one.
Why long messages hold fewer: 153 and 67
When a message does not fit in one segment, it is cut into pieces, and the phone has to put them back in order. Each piece therefore starts with a header that carries a reference number, the total number of pieces, and the position of this piece. Twilio's documentation says that this user data header takes 6 bytes, which leaves 153 characters for a GSM-7 segment and 67 for a UCS-2 segment.
The arithmetic is the same as before. Six bytes are 48 bits, which is a little under 7 characters of 7 bits, so the header costs 7 characters and 160 minus 7 is 153. In UCS-2 it is 3 characters of 16 bits, so 70 minus 3 is 67. Twilio notes one exception: US and Canadian toll-free numbers allow 152 and 66 in a long message.
This is why the second segment is a bigger step than it looks. A message of 160 characters is one segment. At 161 characters it is two, and it stays two up to 306 characters. Three segments reach 459 characters. In Unicode the same steps are 70, 134, and 201. Twilio's own example is a body of 152 GSM-7 characters and one Unicode character, which is split into 3 messages when it is encoded in UCS-2.
- GSM-7: 160 in one segment, then 153 in each segment of a longer message.
- UCS-2: 70 in one segment, then 67 in each segment of a longer message.
- Segments reach 306, 459, and 612 characters in GSM-7, and 134, 201, and 268 in UCS-2.
Characters that count twice
The GSM alphabet has a second table, the extension table, which holds a few more characters. According to Wikipedia they are the euro sign, the square brackets, the curly braces, the backslash, the caret, the tilde, the vertical bar, and the form feed. Each of these is sent as an escape code followed by the character, so each takes two units. Twilio says that escape characters count as two characters in a GSM-7 message.
This surprises people who write templates. A message with four fields written like {{name}} has sixteen curly braces, and each one costs two units. The template is sixteen units longer than its character count suggests. A text with a few square brackets or a euro sign can also lose room that you did not count.
The standard adds a warning. A phone that receives an escape it does not know shows it as a space, so the extension characters are the first to fail on an old handset.
Look-alike characters that quietly switch to Unicode
Most Unicode messages are not meant to be Unicode. Twilio's documentation says that text editors designed for writing may add angled smart quotes, non-standard spaces, or punctuation that looks like GSM-7 but is a different Unicode character. A word processor turns a straight apostrophe into a curly one, a hyphen into a long dash, and three dots into one ellipsis character. A web page or a PDF adds a non-breaking space or a zero-width space. The text looks the same on the screen and costs much more.
Some providers replace such characters for you. Telnyx documents a smart encoding feature that substitutes a list of more than 200 characters, such as curly quotes by straight ones and long dashes by hyphens, and notes that it cannot convert emoji or non-Latin scripts. It also notes that an ellipsis becomes three periods, which adds two characters, so a message can grow while it gets cheaper. Check what your provider does, and do not assume it.
What it costs
Providers usually price by segment, so every step in the table above is a step in the bill. A 161-character message costs twice as much as a 160-character one. A Unicode message of 71 characters costs twice as much as one of 70. Across thousands of messages the difference between one and two segments is the difference between a small campaign and a large one.
The effect of the encoding is the larger of the two. A message of 150 plain characters is one segment, and the same message with a single emoji is three, because the emoji is two 16-bit units and 152 units need three segments of 67. A French message of 100 characters with a lowercase ç is also two segments, because ç is not in the default alphabet. Checking a message before it is sent is cheaper than finding out from an invoice.
How to keep a message in one segment
Write for the limit from the start. Use straight quotes and hyphens, and avoid emoji unless they are worth the extra cost. Keep fields short, and remember that a field is replaced by its real value, which may be much longer than the field name. Count the message after the fields are filled in, with the longest value that a real recipient could have.
- Replace curly quotes, long dashes, and the single ellipsis character with plain ones.
- Remove non-breaking spaces and zero-width characters that were pasted from a web page or a document.
- Avoid characters outside the GSM alphabet, including some accented letters, when the language allows.
- Remember that the euro sign, braces, brackets, the backslash, the caret, the tilde, and the vertical bar count twice.
- Count the message with the longest realistic values in its fields.
- Put the important part first, in case an old phone or a gateway cuts the end.
Where a segment ends
A character that takes two units cannot be cut in half. The standard says that a receiving device decodes each segment of a long message on its own, so an escape code at the end of a segment would arrive without its character. A well-made sender moves the whole character to the next segment, and the previous one is left one unit short. The same is true of an emoji in a Unicode message, which is stored as two 16-bit units.
Many counters add up the units and divide by the segment size, which gives the right number most of the time and a wrong one when a two-unit character sits at a border. The SMS counter on this site counts piece by piece, and in the test it was compared with the Python gsm0338 codec for every character in the Basic Multilingual Plane and with the smsutil library on 758 texts built to land on and around every segment border. They agreed on all of them. Both follow the same rule for a two-unit character, so the agreement shows that the count is right under that rule, not that every carrier follows it.
SMS, MMS, and other channels
An MMS is not cut into segments in this way. AWS End User Messaging documents that the text body of an MMS can hold up to 1,600 characters from any character set and is not broken into multiple parts. Limits differ by provider and by country, and an MMS is usually priced differently, so it is not a way to avoid the cost of an SMS without checking the price.
Other channels, such as chat apps, do not use these limits at all. If your message does not have to be a text, a channel without segments has no 160 or 70 to worry about. For a text message, the numbers in this guide are the rules, and they come from the size of a message and the size of a character.
Practical checklist
- Remember that one text carries 140 bytes: 160 characters in GSM-7, or 70 in UCS-2.
- Remember that a longer message holds 153 or 67 characters in each segment.
- Count the euro sign, braces, brackets, the backslash, the caret, the tilde, and the bar as two characters.
- Replace smart quotes, long dashes, the ellipsis character, and odd spaces before sending.
- Avoid emoji and non-GSM letters when one segment matters.
- Count the message after the fields are filled in, using the longest realistic values.
- Check what your provider does about encoding, because some replace characters and some do not.
- Check the price per segment, and the exceptions for toll-free numbers.
Research and references
This guide was prepared from the authoritative references below.
- Wikipedia: GSM 03.38 (the GSM 7-bit default alphabet and extension table)
- 3GPP TS 23.038: Alphabets and language-specific information
- Twilio: How long can a message be?
- Twilio: What is GSM-7 character encoding?
- Twilio: What is UCS-2 character encoding?
- Telnyx: Smart Encoding
- AWS End User Messaging: MMS file types, size and character limits



