LockerGnomeTech news and nostalgia for today's technology professionals
Subscribe

Search

SoftwareSMS3GPPGSMUCS2protocols

The 160-character text message limit is 3GPP's own arithmetic: 140 bytes packed at 7 bits each, and 16-bit UCS2 texts hold 70

The standard never sets a character count. It sets a payload size in bytes, and the number people plan their messages around falls out of how many bits each character costs.

Chris Pirillo, in the style of an old fruit crate label, presses one last small envelope into a wooden crate packed tight with envelopes.
Illustration: LockerGnome

The spec that defines how a text message is encoded runs to dozens of pages of alphabet tables, and the famous number sits in one sentence at the end of a bit-packing diagram. After showing how seven-bit characters are laid across eight-bit bytes, with the bit pattern of each character spilling into the next octet, the spec says: “Therefore, in 140 octets, it is possible to pack (140x8)/7=160 characters.”

That’s the division sum. A text message has 140 bytes of room for the user’s data. A byte is 8 bits and a GSM character is 7. So 140 times 8 is 1,120 bits, divided by 7 bits a character, is 160 characters. No committee decided texts should be 160 characters long. The payload size came first, and 160 is what fits.

The spec states the result as a rule for the default alphabet: when it’s used, “the characters of the message are packed in octets as shown in clause 6.1.2.1.1, and the message can consist of up to 160 characters.” It adds that the 7-bit default alphabet “shall be supported by all MSs and SCs offering the service,” meaning every phone and every message center has to understand it.

The same 140 bytes hold less when the alphabet changes. The spec lets a message announce that its user data uses UCS2, a 16-bit character set, and in that case “the message can consist of up to 140 octets, i.e. up to 70 UCS2 characters.” Section 6.2.3 gives the cost in a single line: “Bits per character: 16.” Sixteen bits instead of seven is why 160 becomes 70, since 140 bytes is still 140 bytes.

The default alphabet also has a back door. Some characters aren’t in the main table and are reached through an escape. The spec describes the mechanism as <escape><character>, and the extension table behind it “is reserved for symbols of international significance (e.g currency symbols).” Each such character costs an escape code plus the character, so one of them takes two of the 160 slots. The spec’s own wording about language-specific tables makes the same point: every character from the National Language Single Shift Table needs “an additional character to identify the escape,” and the available capacity “will therefore be reduced accordingly.”

Stories about who picked the number and why circulate, and none of them is in the spec. What the spec proves is the arithmetic, so that’s what this piece sticks to.

The copy read here is TS 23.038 version 17.0.0, Release 17, dated April 2022 on its ETSI cover. Billions of people still plan a message around a number that is a division problem with a remainder of zero.

The limit also explains why an app that counts characters for you is quietly doing octet math. The spec’s 140 octets stay fixed and the character count is the part that moves.

The sum took one line.

More Software

Every Software story →