LIN Frame Utility

LIN Frame & Protected ID Calculator

Calculate or decode LIN protected identifiers, verify P0 and P1 parity bits, inspect six-bit frame IDs and calculate classic or enhanced LIN checksums for data fields of up to eight bytes.

✓ Frame ID ✓ Protected ID ✓ P0 / P1 ✓ Classic Checksum ✓ Enhanced Checksum
LIN
Protected ID & Frame Calculator
● Ready
LIN uses a 6-bit identifier plus two parity bits to form the transmitted PID.
Enhanced checksum includes the PID. Classic checksum uses only data bytes.
Encode mode accepts frame ID 0–63. Decode mode accepts one PID byte 0–255. Decimal and hexadecimal values are supported.
Optional 0–8 data bytes. Spaces, commas, colons, hyphens and 0x prefixes are accepted.
LIN parity equations: P0 = ID0 ⊕ ID1 ⊕ ID2 ⊕ ID4 and P1 = ¬(ID1 ⊕ ID3 ⊕ ID4 ⊕ ID5). The transmitted Protected Identifier is ID | (P0<<6) | (P1<<7).
LIN Frame Result Calculated
Protected Identifier
Frame ID
Protected ID
ID Binary
P0
P1
Parity Status
Checksum Type
Checksum
Data Bytes
Data
Diagnostic ID
Response Bytes
Calculation Breakdown

What Is a LIN Protected Identifier?

LIN uses a six-bit frame identifier rather than transmitting the identifier directly as an unprotected byte. Two parity bits are calculated from the six identifier bits and inserted into bits 6 and 7.

The resulting eight-bit value is called the Protected Identifier, commonly abbreviated PID.

LIN Protected ID Bit Layout

Protected Identifier: Bit 7 Bit 6 Bit 5 ... Bit 0 P1 P0 ID5 ... ID0 Frame ID: 6 bits Protected ID: 8 bits

LIN Parity Calculation

LIN defines two parity equations using selected bits from the six-bit identifier.

P0 = ID0 XOR ID1 XOR ID2 XOR ID4 P1 = NOT( ID1 XOR ID3 XOR ID4 XOR ID5 ) Protected ID = ID | (P0 << 6) | (P1 << 7)

LIN Frame ID Range

The identifier contains six bits, so its numeric range is 0 through 63, or hexadecimal 0x00 through 0x3F.

Minimum ID: 0 Maximum ID: 63 Hex range: 0x00 – 0x3F

Example LIN Protected ID

For frame ID 0x12, the six identifier bits are evaluated by the two parity equations and combined into the transmitted PID.

Frame ID: 0x12 Binary: 010010 ID0 = 0 ID1 = 1 ID2 = 0 ID3 = 0 ID4 = 1 ID5 = 0 P0 = ID0 XOR ID1 XOR ID2 XOR ID4 = 0 XOR 1 XOR 0 XOR 1 = 0 P1 = NOT(ID1 XOR ID3 XOR ID4 XOR ID5) = NOT(1 XOR 0 XOR 1 XOR 0) = 1 Protected ID: 0x92

LIN Classic Checksum

The classic LIN checksum is calculated using the data bytes only. Byte values are summed using end-around carry and then one’s complemented.

Classic Checksum Input: Data0 Data1 ... DataN PID is NOT included.

Classic checksum is required for LIN diagnostic frame identifiers 0x3C and 0x3D.

LIN Enhanced Checksum

The enhanced checksum uses the same checksum arithmetic but includes the Protected Identifier before the data bytes.

Enhanced Checksum Input: PID Data0 Data1 ... DataN

Enhanced checksum is normally used for applicable LIN 2.x unconditional frames, while the diagnostic identifiers remain an important exception.

LIN Checksum End-Around Carry

LIN checksum addition is not simply a normal eight-bit modulo sum. When the sum exceeds 0xFF, the carry is added back into the low byte.

Example: 0xF0 + 0x30 = 0x120 Low byte: 0x20 Carry: 1 End-around sum: 0x21

After all bytes are accumulated, the final eight-bit sum is inverted to produce the checksum.

LIN Diagnostic Identifiers 0x3C and 0x3D

Frame ID Typical Role Checksum Rule
0x3C Master Request Frame Classic
0x3D Slave Response Frame Classic

These identifiers are reserved for diagnostic communication. The calculator’s Automatic checksum option therefore selects classic checksum for IDs 0x3C and 0x3D.

LIN Frame Structure

Header: Break Sync = 0x55 Protected Identifier Response: Data Byte 0 ... Data Byte N Checksum

The LIN master generates the header. Depending on the schedule and frame definition, either the master or a slave may publish the response bytes.

Decode a LIN Protected ID

When decoding a PID, the calculator extracts bits 0 through 5 as the frame ID, reads transmitted P0 and P1 from bits 6 and 7, recalculates both parity bits and compares them.

PID: 0x92 Frame ID: 0x12 Received P0: 0 Received P1: 1 Calculated P0: 0 Calculated P1: 1 Parity: VALID

LIN Frame & Protected ID Calculator FAQs

What is a LIN protected ID?
It is an eight-bit field containing the six-bit LIN frame identifier plus two calculated parity bits.
What is the LIN frame ID range?
A LIN identifier contains six bits, so valid IDs range from 0 to 63.
How is LIN P0 calculated?
P0 is ID0 XOR ID1 XOR ID2 XOR ID4.
How is LIN P1 calculated?
P1 is the inverted result of ID1 XOR ID3 XOR ID4 XOR ID5.
What is the protected ID for LIN ID 0x12?
Using the LIN parity equations, frame ID 0x12 produces protected identifier 0x92.
What is a classic LIN checksum?
It is a one’s-complement checksum calculated from the response data bytes without including the protected identifier.
What is an enhanced LIN checksum?
It is calculated using the protected identifier plus the response data bytes.
Do diagnostic LIN frames use enhanced checksum?
The reserved diagnostic identifiers 0x3C and 0x3D use the classic checksum rule.
How many data bytes can a LIN frame contain?
A normal LIN response can carry up to eight data bytes.
Can this tool validate a received PID?
Yes. Select Protected ID → Frame ID and the tool compares the received P0 and P1 bits against the parity values recalculated from the six-bit identifier.

Calculate LIN Frame IDs, PIDs and Checksums

Generate or decode LIN protected identifiers, verify parity bits and calculate classic or enhanced checksums for LIN bus response data.

Scroll to Top