J1939 DTC Decoder
Decode a J1939 Diagnostic Trouble Code from its 4-byte DTC representation. Extract the SPN, FMI, occurrence count (OC) and conversion method (CM) used in SAE J1939 diagnostic messages such as DM1 and DM2.
-
What Is a J1939 DTC Decoder?
A J1939 DTC Decoder converts the four bytes used to represent a Diagnostic Trouble Code in SAE J1939 diagnostic messages into its individual fields. The most important values are the Suspect Parameter Number (SPN), Failure Mode Identifier (FMI), occurrence count and conversion method bit.
J1939 diagnostics are commonly encountered in heavy-duty vehicles, commercial trucks, agricultural machinery, construction equipment, industrial engines and other CAN-based systems using the J1939 protocol. A raw diagnostic capture may expose the DTC as hexadecimal bytes rather than as immediately readable SPN and FMI values.
This calculator performs the bit extraction directly in your browser so you can move between raw DTC bytes and the corresponding numerical diagnostic fields.
J1939 DTC Format
A J1939 diagnostic trouble code occupies four bytes. Under the commonly used current DTC conversion method, the SPN occupies 19 bits, FMI occupies 5 bits, the occurrence count occupies 7 bits, and CM occupies the remaining bit.
| Field | Size | Purpose |
|---|---|---|
| SPN | 19 bits | Identifies the suspect parameter or component. |
| FMI | 5 bits | Describes the detected failure mode. |
| OC | 7 bits | Occurrence count associated with the DTC. |
| CM | 1 bit | Indicates the DTC conversion method. |
How to Decode a J1939 DTC
From a DM1 or DM2 message, identify the four bytes belonging to the diagnostic trouble code you want to decode.
For example, enter a sequence such as E8 03 05 82 without reversing the byte order.
The first two bytes and the upper three bits of byte three form the 19-bit SPN.
The lower five bits of the third DTC byte contain the FMI value.
The lower seven bits of byte four contain occurrence count and its most significant bit contains CM.
J1939 SPN Decoding Formula
For the current J1939 DTC encoding method, the 19-bit SPN is assembled from all eight bits of byte 1, all eight bits of byte 2, and bits 7 through 5 of byte 3.
The resulting value can range from 0 through 524287 because nineteen binary bits are available for the SPN field.
J1939 FMI Decoding
The Failure Mode Identifier occupies the lower five bits of the third DTC byte. Therefore the FMI can be extracted with a five-bit mask.
An FMI does not independently identify the faulty component. It describes the type of detected condition associated with the SPN. The SPN and FMI therefore need to be interpreted together.
Common J1939 FMI Values
FMI values provide standardized categories describing how a parameter or signal has failed. The exact diagnostic interpretation still depends on the SPN and equipment documentation.
| FMI | General Meaning |
|---|---|
| 0 | Data valid but above normal operational range — most severe level. |
| 1 | Data valid but below normal operational range — most severe level. |
| 2 | Data erratic, intermittent or incorrect. |
| 3 | Voltage above normal or shorted to high source. |
| 4 | Voltage below normal or shorted to low source. |
| 5 | Current below normal or open circuit. |
| 6 | Current above normal or grounded circuit. |
| 7 | Mechanical system not responding or out of adjustment. |
| 8 | Abnormal frequency, pulse width or period. |
| 9 | Abnormal update rate. |
| 10 | Abnormal rate of change. |
| 11 | Failure mode not identifiable. |
| 12 | Bad intelligent device or component. |
| 13 | Out of calibration. |
| 14 | Special instructions. |
| 15 | Data valid but above normal operating range — least severe level. |
| 16 | Data valid but above normal operating range — moderately severe level. |
| 17 | Data valid but below normal operating range — least severe level. |
| 18 | Data valid but below normal operating range — moderately severe level. |
| 19 | Received network data in error. |
| 31 | Condition exists. |
Occurrence Count (OC) in J1939
The occurrence count is stored in the lower seven bits of the fourth DTC byte. It provides information associated with how many occurrences of the diagnostic condition have been recorded, subject to the behavior defined by the ECU and applicable J1939 diagnostics.
What Is the J1939 CM Bit?
CM means Conversion Method. It occupies bit 8, the most significant bit, of the fourth DTC byte.
A CM value of 0 identifies the current/version-4 style DTC conversion method. A CM value of 1 indicates the earlier conversion method. Because the SPN layout differs for the older method, a decoder should not blindly apply the current SPN formula to a CM=1 DTC.
J1939 DTC Decode Example
Consider the four bytes:
Byte 2 = 0x03 = 3
Byte 3 = 0x05
Byte 4 = 0x82 SPN = 232 + (3 × 256) + 0 = 1000 FMI = 0x05 & 0x1F = 5 OC = 0x82 & 0x7F = 2 CM = 0x82 >> 7 = 1
Notice that this particular demonstration produces CM=1. The byte fields can still be extracted, but CM tells you that the older conversion method applies, so the current SPN interpretation should not be treated as authoritative.
J1939 DM1 and DTCs
DM1 is the J1939 Active Diagnostic Trouble Codes message. It communicates currently active diagnostic conditions and also includes diagnostic lamp information. A DM1 payload can contain one or more four-byte DTC structures.
The first bytes of the diagnostic message are associated with lamp status. The DTC records follow them. Therefore, when using a raw DM1 payload with this calculator, do not enter the lamp-status bytes as though they were part of the DTC.
J1939 DM2 and Previously Active DTCs
DM2 is used for previously active diagnostic trouble codes. Its DTC records use the same diagnostic field concepts—SPN, FMI, occurrence count and CM—but the message represents faults that were previously active rather than the currently active set represented by DM1.
This makes the decoder useful when examining both live diagnostic captures and stored diagnostic information from J1939 ECUs.
SPN vs FMI: What Is the Difference?
SPN
The Suspect Parameter Number identifies the parameter, signal, component or system associated with the diagnostic condition.
FMI
The Failure Mode Identifier describes the general manner in which that parameter or component is considered abnormal.
For example, an SPN might identify a pressure, temperature, sensor circuit or other parameter while the FMI indicates that its value is too high, too low, erratic, open circuit or otherwise abnormal.
Why a J1939 DTC Is Not the Same as an OBD-II Code
J1939 diagnostic trouble codes should not be confused with passenger-vehicle OBD-II codes such as P0300. J1939 uses the SPN/FMI diagnostic model and is widely used in heavy-duty and commercial equipment.
An SPN/FMI pair therefore should not be converted into a P-code by simply reformatting the number. Equipment manufacturers may provide additional cross-references, but those mappings are separate from the J1939 DTC bit decoding performed here.
Common J1939 DTC Decoding Mistakes
Reversing the Four Bytes
Enter the DTC bytes in their transmitted order rather than reversing the entire four-byte sequence as one integer.
Using All of Byte 3 as FMI
Only the lower five bits of byte three belong to FMI in the current format.
Ignoring the SPN Upper Bits
The upper three bits of byte three contribute to the 19-bit SPN.
Using All of Byte 4 as OC
Only the lower seven bits are occurrence count because the upper bit is CM.
Ignoring CM
CM indicates which DTC conversion method applies and matters when interpreting the SPN encoding.
Entering a Complete DM1 as One DTC
A DM1 message can contain lamp information and multiple DTC records. Isolate the appropriate four-byte DTC first.
J1939 DTC Decoder FAQs
What is a J1939 DTC?
What does SPN mean in J1939?
What does FMI mean?
How many bits are used for a J1939 SPN?
How many bits are used for FMI?
What is OC in a J1939 fault code?
What is CM in a J1939 DTC?
Can this decoder read DM1 messages?
Can the decoder be used with DM2?
Is J1939 the same as OBD-II?
Why do I need the SPN and FMI together?
What is the maximum occurrence count?
Can I enter 0x-prefixed hexadecimal bytes?
Does the decoder identify the actual component name from the SPN?
Why can a manufacturer manual still be necessary?
Decode J1939 SPN, FMI, OC and CM
Paste a four-byte J1939 diagnostic trouble code to extract its diagnostic fields, inspect the underlying bit calculation and convert between raw DTC bytes and SPN/FMI values directly in your browser.