Free tool · Runs in your browser · No signup

SMS PDU Decoder & Encoder

Paste the raw hex of an SMS-SUBMIT or SMS-DELIVER PDU and get every field decoded — service-centre address, first octet, sender/destination with TON/NPI, protocol identifier, data coding scheme, timestamp, UDH concatenation and the unpacked message text (GSM-7 or UCS-2). The Encode tab builds a clean SMS-SUBMIT hex from a number and a message, with a live septet/segment meter. Everything runs in your browser — nothing is sent anywhere.

No signupStatic, client-sideGSM 03.40 / TS 23.040 faithful

Spaces and newlines are stripped. Odd-length hex is rejected. Toggle SCA if your hex starts at the first octet (FO) instead of a service-centre address.

E.164 with optional leading + (TON=1 international), or alphanumeric DA text (TON=5).

What an SMS PDU is

A PDU (Protocol Data Unit) is the on-the-wire binary form of an SMS as specified in GSM 03.40 and 3GPP TS 23.040. Handsets, SMSCs, and many modem AT command sets (AT+CMGS in PDU mode) exchange messages as hex-encoded octets rather than plain text. Those octets carry the service-centre address, a first-octet bitfield (message type, UDHI, status-report request, validity-period format, and more), the originator or destination address with TON/NPI, a protocol identifier, a data coding scheme, optional timestamp or validity period, and finally the user data — often GSM-7 default alphabet packed seven bits per character into octets, or UCS-2 big-endian for characters outside the GSM alphabet.

SMS-SUBMIT vs SMS-DELIVER

SMS-DELIVER (MTI bits = 00) is what the service centre delivers to the recipient. It includes an originator address (OA) and a service-centre time stamp (SCTS) encoded as semi-octet BCD with a timezone in quarter-hour units. SMS-SUBMIT (MTI = 01) is what a mobile-originated client sends to the SC: it carries a destination address (DA), a message reference (MR), and an optional validity period whose presence and format are selected by the VPF bits. This tool decodes both TPDU types and encodes SMS-SUBMIT only (no status-report, no SMS-COMMAND).

GSM-7 packing, UDH, and padding

GSM-7 packs character septets into octets with a running bit offset. When the UDHI bit is set, a user-data header precedes the text. The UDL still counts septets (for 7-bit) or octets (for 8-bit/UCS-2) including the header. After a UDH of N octets (plus the UDHL byte itself), the septet payload begins on the next septet boundary — that means ((udhl+1)*8 + 6) / 7 septets are consumed by the header and padding, and the decoder must skip the corresponding fill bits before unpacking characters. Concatenation commonly uses IEI 0x00 (8-bit reference: ref, total, seq) or IEI 0x08 (16-bit reference).

Worked examples

Spec-valid PDU samples
DirectionHex (abbrev.)Result
DELIVER 7-bit0791…F0040B91…0005E8329BFD06OA +31620000000, text “hello”
SUBMIT 7-bit0011000B912131444000F0000004D4F29C0EDA 12314440000, text “Test”
DELIVER UCS-2…00080004 004F004BDCS 0x08, text “OK”
SUBMIT concat0015…0A050003000201C8329BFD06UDHI, ref 0, part 1/2, “hello”

Related tools

Frequently asked questions

What is an SMS PDU?

A PDU (Protocol Data Unit) is the binary encoding of an SMS as defined in GSM 03.40 / 3GPP TS 23.040. Instead of plain text, the message is packed into octets that carry the service-centre address, first octet (MTI, UDHI, and flags), originator or destination address, protocol identifier, data coding scheme, optional timestamp or validity period, and the user data — often GSM-7 septets packed 7 bits per character, or UCS-2 big-endian for non-GSM characters.

What is the difference between SMS-SUBMIT and SMS-DELIVER?

SMS-SUBMIT (MTI=01) is the TPDU a mobile or application sends toward the service centre — it carries a destination address, message reference, and optional validity period. SMS-DELIVER (MTI=00) is what the service centre sends to the recipient handset — it carries an originator address and a service-centre timestamp (SCTS). This tool decodes both directions and encodes SMS-SUBMIT only.

How does UDH concatenation work in an SMS PDU?

When a message is longer than one segment, the user-data header (UDH) carries a concatenation information element. IEI 0x00 uses an 8-bit reference with three bytes of data (ref, total, sequence); IEI 0x08 uses a 16-bit reference with four bytes. Setting the UDHI bit in the first octet tells the decoder to parse the UDH before unpacking GSM-7 septets, and the septet stream is bit-aligned after the header (padding bits fill to the next septet boundary).