Visual RFC.
ALL RFCs / RFC 6455
Read the RFC ↗
RFC 6455 / EXCHANGE MESSAGES

Frame fields

03

FIN, opcode, mask state, length, and optional masking key let the receiver interpret one frame.

Related RFCs and changes

“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.

DIAGRAM§ 5.2 ↗
RFC 6455 · § 5.2EXAMPLE
3 / 3
Frame fieldsA client frame progressively reveals FIN/opcode, mask and length fields, its masking key, and the recovered five-byte text payload.Anatomy of one client text frameIllustrative field grouping, not bit-width scaleFIN1RSV000opcode0x1MASK1length5MASK=1: four key bytes follow32-bit masking key: 37 FA 21 3DHelloFive recovered UTF-8 bytes form the payloadUnmask and interpret the text payload
03
Interpret the frame content.

In this illustrated client text frame, unmask five bytes to recover Hello.

Protocol participantThreat or exceptionProtocol controlSimplified drawings · precise section references
KEY POINT

Read control fields before interpreting the payload.

  • FIN marks the final fragment; opcode identifies continuation, text, binary, or a control frame. Reserved bits are zero unless an extension defines them.
  • Payload lengths 0–125 fit directly; 126 and 127 introduce extended-length fields. The high bit of a 64-bit length must be zero.
  • Client-to-server frames set MASK and carry a 32-bit masking key; server-to-client frames are not masked.
DETAILS

A single message can span multiple frames. Payload length includes extension data when extensions add it; implementations should impose appropriate resource limits.

Read the RFC section ↗

Diagrams simplify the RFC. Read the linked sections for complete requirements.

Privacy
All chapters in this RFC
  1. Opening handshake
  2. Messages in both directions
  3. Frame fields
  4. Fragments and control frames
  5. Client masking
  6. Closing the connection
RFC 9700 / CHAPTERS

Chapters

For full details, tables, algorithms, and exceptions, read the original RFC.

RFC status and corrections ↗