Matter Protocol Encode/Decode
Online Matter protocol encode/decode tool with TLV parsing/building, onboarding payload decode/generation, and C-struct schema mapping for smart home integration debugging and protocol troubleshooting.
Paste TLV bytes captured from Matter packets, logs, or protocol tools
Click to load examples
Decoded Result
Enter TLV data to parse automatically
JSON View
Enter TLV data to parse automatically
Matter Protocol Guide
TLV Element Type Reference
| Type Name | Type Code | Value Length |
|---|---|---|
| Signed Integer | 0x00-0x03 | 1/2/4/8 bytes |
| Unsigned Integer | 0x04-0x07 | 1/2/4/8 bytes |
| Boolean | 0x08-0x09 | 0 byte |
| Floating Point | 0x0A-0x0B | 4 or 8 bytes |
| UTF-8 String | 0x0C-0x0F | length prefix + data |
| Byte String | 0x10-0x13 | length prefix + data |
| Null | 0x14 | 0 byte |
| Struct | 0x15 | container, ends with 0x18 |
| Array | 0x16 | container, ends with 0x18 |
| List | 0x17 | container, ends with 0x18 |
| End Of Container | 0x18 | 0 byte |
What is Matter
Matter is a unified smart-home interoperability standard driven by CSA, enabling cross-platform device communication across major ecosystems and IoT deployments.
Matter TLV Encoding
Matter uses compact TLV (tag-length-value) binary encoding for structured data in interaction model messages, onboarding payloads, and device credentials.
Control Byte Structure
The first byte of each TLV element stores both element type (lower 5 bits) and tag form (upper 3 bits). Tag and length fields follow based on type.
| Bit Field | Description |
|---|---|
| Bits [4:0] | element type |
| Bits [7:5] | tag form: anonymous/context/profile/fully-qualified |
C Struct Schema Guide
Schema mode parses C/C++ struct definitions and generates field forms to quickly build tagged TLV payloads.
Supported Syntax
- typedef struct body StructName;
- typedef struct Tag body StructName;
- struct StructName body;
Supported Types
| Category | C/C++ | TLV |
|---|---|---|
| Signed Integer | int8_t/int16_t/int32_t/int64_t | int |
| Unsigned Integer | uint8_t/uint16_t/uint32_t/uint64_t | uint |
| Boolean | bool/_Bool | bool |
| Floating | float/double | float/double |
| String | char[]/char* | utf8 |
| Byte String | uint8_t[]/uint8_t* | bytes |
Onboarding Payload Format
Onboarding payload can be represented as MT QR string, 11/21-digit manual code, or mt NFC URI, carrying version, VID/PID, discriminator, and passcode.
Base38 Encoding
Matter QR payload uses Base38 characters (0-9, A-Z, -.) to keep payload compact and compatible with QR alphanumeric mode.
Manual Pairing Code
The 11-digit manual code includes short discriminator and passcode. The 21-digit version extends it with vendor/product identifiers and Verhoeff check digit.
Common Use Cases
- Decode TLV bytes from Matter packet captures
- Build interaction model request/response samples
- Validate onboarding data in QR and manual codes
- Troubleshoot commissioning and authentication issues
- Generate payloads for protocol interoperability tests
Specification References
- Matter Core Specification (CSA)
- connectedhomeip open-source repository
- Matter SDK documentation
- Build with Matter Handbook