J1939 Diagnostic Decoder

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.

✓ SPN Decoder ✓ FMI Decoder ✓ OC Decoder ✓ CM Bit ✓ DM1 / DM2
DTC
Decode J1939 Diagnostic Trouble Code
● Ready
4 hexadecimal bytes
Enter exactly four DTC bytes in transmission order. Spaces, commas, hyphens and 0x prefixes are accepted.
Input scope: This decoder handles the standard four-byte J1939 DTC structure itself. If you captured a complete DM1 CAN payload, isolate each four-byte DTC after the two lamp-status bytes before decoding it here.
Decoded J1939 DTC Valid 4-Byte DTC
Decoded Diagnostic Trouble Code
SPN
FMI
Occurrence Count
CM
Byte 1
Byte 2
Byte 3
Byte 4
Bit-Level Calculation -

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

Locate the four DTC bytes

From a DM1 or DM2 message, identify the four bytes belonging to the diagnostic trouble code you want to decode.

Enter the bytes in transmission order

For example, enter a sequence such as E8 03 05 82 without reversing the byte order.

Decode the SPN

The first two bytes and the upper three bits of byte three form the 19-bit SPN.

Decode the FMI

The lower five bits of the third DTC byte contain the FMI value.

Read OC and CM

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.

If the four DTC bytes are represented as B1, B2, B3 and B4: SPN = B1 + (B2 × 256) + ((B3 & 0xE0) × 2048) Equivalent bit-shift form: SPN = B1 | (B2 << 8) | ((B3 & 0xE0) << 11)

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.

FMI = B3 & 0x1F

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
0Data valid but above normal operational range — most severe level.
1Data valid but below normal operational range — most severe level.
2Data erratic, intermittent or incorrect.
3Voltage above normal or shorted to high source.
4Voltage below normal or shorted to low source.
5Current below normal or open circuit.
6Current above normal or grounded circuit.
7Mechanical system not responding or out of adjustment.
8Abnormal frequency, pulse width or period.
9Abnormal update rate.
10Abnormal rate of change.
11Failure mode not identifiable.
12Bad intelligent device or component.
13Out of calibration.
14Special instructions.
15Data valid but above normal operating range — least severe level.
16Data valid but above normal operating range — moderately severe level.
17Data valid but below normal operating range — least severe level.
18Data valid but below normal operating range — moderately severe level.
19Received network data in error.
31Condition 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.

OC = B4 & 0x7F The seven-bit field can represent values from: 0 to 127

What Is the J1939 CM Bit?

CM means Conversion Method. It occupies bit 8, the most significant bit, of the fourth DTC byte.

CM = (B4 >> 7) & 1

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.

This calculator clearly reports the CM value. The automatic SPN extraction from raw bytes is intended for the current CM=0 representation; CM=1 is flagged so older-format data is not silently misinterpreted.

J1939 DTC Decode Example

Consider the four bytes:

E8 03 05 82 Byte 1 = 0xE8 = 232
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?
A J1939 Diagnostic Trouble Code is a four-byte diagnostic structure containing an SPN, FMI, occurrence count and conversion method bit.
What does SPN mean in J1939?
SPN means Suspect Parameter Number. It identifies the parameter or component associated with a diagnostic condition.
What does FMI mean?
FMI means Failure Mode Identifier. It describes the general type of failure associated with the SPN.
How many bits are used for a J1939 SPN?
The current J1939 DTC conversion method provides 19 bits for the SPN, allowing values from 0 through 524287.
How many bits are used for FMI?
FMI occupies five bits and therefore has a numerical range of 0 through 31.
What is OC in a J1939 fault code?
OC means occurrence count. It occupies the lower seven bits of the fourth DTC byte.
What is CM in a J1939 DTC?
CM is the conversion method bit. It indicates whether the current or an older DTC conversion method is being represented.
Can this decoder read DM1 messages?
It decodes the four-byte DTC records contained in DM1. If you have an entire DM1 payload, first separate the lamp-status bytes and identify each DTC record.
Can the decoder be used with DM2?
Yes. The four-byte diagnostic records in DM2 can be analyzed for their SPN, FMI, OC and CM fields.
Is J1939 the same as OBD-II?
No. J1939 commonly uses SPN and FMI diagnostics, while OBD-II commonly exposes codes such as P0300. They are different diagnostic systems.
Why do I need the SPN and FMI together?
SPN identifies what parameter or component is involved, while FMI describes the type of abnormal condition detected for it.
What is the maximum occurrence count?
The OC field contains seven bits, so its numerical range is 0 through 127.
Can I enter 0x-prefixed hexadecimal bytes?
Yes. The decoder accepts common forms such as E8 03 05 02 and 0xE8 0x03 0x05 0x02.
Does the decoder identify the actual component name from the SPN?
This tool performs the DTC bit decoding itself. Exact SPN definitions and manufacturer-specific diagnostic instructions should be checked against the appropriate J1939 or equipment documentation.
Why can a manufacturer manual still be necessary?
The raw DTC tells you SPN and FMI values, but troubleshooting procedures, component locations and manufacturer-specific diagnostic information can vary by vehicle, engine or ECU.

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.

Scroll to Top