CAN Bus Frame & Bitfield Signal Decoder

Decode Intel and Motorola DBC signals from 8-byte CAN or 16-byte CAN FD payloads and inspect the exact bits.

Jump to results

Inputs

Captured payload
Classic CAN 8 bytes or CAN FD 16 bytes. Spaces are optional.
DBC signals
Signal 1
Signal 2
Signal 3
Signal 4

Results

Estimates
Decoded signals4
Pack voltage
112.74 V
Pack current
-0.9 A
State of charge
9 %
Cell temperature
12 °C
Bit map · 64 bits
B0 · 0AB1 · 2CB2 · 00B3 · F1B4 · 12B5 · 34B6 · 56B7 · 7876543210 Bit 7 = 0 · Pack voltage 0 Bit 6 = 0 · Pack voltage 0 Bit 5 = 0 · Pack voltage 0 Bit 4 = 0 · Pack voltage 0 Bit 3 = 1 · Pack voltage 1 Bit 2 = 0 · Pack voltage 0 Bit 1 = 1 · Pack voltage 1 Bit 0 = 0 · Pack voltage 0 Bit 15 = 0 · Pack voltage 0 Bit 14 = 0 · Pack voltage 0 Bit 13 = 1 · Pack voltage 1 Bit 12 = 0 · Pack voltage 0 Bit 11 = 1 · Pack voltage 1 Bit 10 = 1 · Pack voltage 1 Bit 9 = 0 · Pack voltage 0 Bit 8 = 0 · Pack voltage 0 Bit 23 = 0 · Pack current 0 Bit 22 = 0 · Pack current 0 Bit 21 = 0 · Pack current 0 Bit 20 = 0 · Pack current 0 Bit 19 = 0 · Pack current 0 Bit 18 = 0 · Pack current 0 Bit 17 = 0 · Pack current 0 Bit 16 = 0 · Pack current 0 Bit 31 = 1 · Pack current 1 Bit 30 = 1 · Pack current 1 Bit 29 = 1 · Pack current 1 Bit 28 = 1 · Pack current 1 Bit 27 = 0 · Pack current 0 Bit 26 = 0 · Pack current 0 Bit 25 = 0 · Pack current 0 Bit 24 = 1 · Pack current 1 Bit 39 = 0 · State of charge 0 Bit 38 = 0 · State of charge 0 Bit 37 = 0 · State of charge 0 Bit 36 = 1 · State of charge 1 Bit 35 = 0 · State of charge 0 Bit 34 = 0 · State of charge 0 Bit 33 = 1 · State of charge 1 Bit 32 = 0 · State of charge 0 Bit 47 = 0 · Cell temperature 0 Bit 46 = 0 · Cell temperature 0 Bit 45 = 1 · Cell temperature 1 Bit 44 = 1 · Cell temperature 1 Bit 43 = 0 · Cell temperature 0 Bit 42 = 1 · Cell temperature 1 Bit 41 = 0 · Cell temperature 0 Bit 40 = 0 · Cell temperature 0 Bit 55 = 0 · unassigned 0 Bit 54 = 1 · unassigned 1 Bit 53 = 0 · unassigned 0 Bit 52 = 1 · unassigned 1 Bit 51 = 0 · unassigned 0 Bit 50 = 1 · unassigned 1 Bit 49 = 1 · unassigned 1 Bit 48 = 0 · unassigned 0 Bit 63 = 0 · unassigned 0 Bit 62 = 1 · unassigned 1 Bit 61 = 1 · unassigned 1 Bit 60 = 1 · unassigned 1 Bit 59 = 1 · unassigned 1 Bit 58 = 0 · unassigned 0 Bit 57 = 0 · unassigned 0 Bit 56 = 0 · unassigned 0

Select a bit to see its position and matching signals.

  • Pack voltage
  • Pack current
  • State of charge
  • Cell temperature

An asterisk marks an overlapping bit.

Decoded signal values
SignalEncodingRaw integerRaw hexPhysical
Pack voltageIntel112740x2C0A112.74 V
Pack currentMotorola2410xF1-0.9 A
State of chargeIntel180x129 %
Cell temperatureIntel520x3412 °C
Generated C99 masks and functions
#include <stdint.h>

/* Pass a validated payload of at least 8 bytes. */
#define DBC_BIT(data, b) ((uint64_t)(((data)[(b) / 8] >> ((b) % 8)) & 1u))

#define DBC_1_PACK_VOLTAGE_MASK UINT64_C(0xFFFF)
#define DBC_1_PACK_VOLTAGE_RAW(data) (( \
    (DBC_BIT((data), 0) << 0) | \
    (DBC_BIT((data), 1) << 1) | \
    (DBC_BIT((data), 2) << 2) | \
    (DBC_BIT((data), 3) << 3) | \
    (DBC_BIT((data), 4) << 4) | \
    (DBC_BIT((data), 5) << 5) | \
    (DBC_BIT((data), 6) << 6) | \
    (DBC_BIT((data), 7) << 7) | \
    (DBC_BIT((data), 8) << 8) | \
    (DBC_BIT((data), 9) << 9) | \
    (DBC_BIT((data), 10) << 10) | \
    (DBC_BIT((data), 11) << 11) | \
    (DBC_BIT((data), 12) << 12) | \
    (DBC_BIT((data), 13) << 13) | \
    (DBC_BIT((data), 14) << 14) | \
    (DBC_BIT((data), 15) << 15) \
) & DBC_1_PACK_VOLTAGE_MASK)
static inline double dbc_1_pack_voltage_physical(const uint8_t data[static 8]) {
    const uint64_t raw = DBC_1_PACK_VOLTAGE_RAW(data);
    const uint64_t value = raw;
    return (double)value * (0.01) + (0.0);
}

#define DBC_2_PACK_CURRENT_MASK UINT64_C(0xFFFF)
#define DBC_2_PACK_CURRENT_RAW(data) (( \
    (DBC_BIT((data), 24) << 0) | \
    (DBC_BIT((data), 25) << 1) | \
    (DBC_BIT((data), 26) << 2) | \
    (DBC_BIT((data), 27) << 3) | \
    (DBC_BIT((data), 28) << 4) | \
    (DBC_BIT((data), 29) << 5) | \
    (DBC_BIT((data), 30) << 6) | \
    (DBC_BIT((data), 31) << 7) | \
    (DBC_BIT((data), 16) << 8) | \
    (DBC_BIT((data), 17) << 9) | \
    (DBC_BIT((data), 18) << 10) | \
    (DBC_BIT((data), 19) << 11) | \
    (DBC_BIT((data), 20) << 12) | \
    (DBC_BIT((data), 21) << 13) | \
    (DBC_BIT((data), 22) << 14) | \
    (DBC_BIT((data), 23) << 15) \
) & DBC_2_PACK_CURRENT_MASK)
static inline double dbc_2_pack_current_physical(const uint8_t data[static 8]) {
    const uint64_t raw = DBC_2_PACK_CURRENT_RAW(data);
    const int64_t value = raw & (UINT64_C(1) << 15)
        ? -INT64_C(1) - (int64_t)(DBC_2_PACK_CURRENT_MASK ^ raw) : (int64_t)raw;
    return (double)value * (0.1) + (-25.0);
}

#define DBC_3_STATE_OF_CHARGE_MASK UINT64_C(0xFF)
#define DBC_3_STATE_OF_CHARGE_RAW(data) (( \
    (DBC_BIT((data), 32) << 0) | \
    (DBC_BIT((data), 33) << 1) | \
    (DBC_BIT((data), 34) << 2) | \
    (DBC_BIT((data), 35) << 3) | \
    (DBC_BIT((data), 36) << 4) | \
    (DBC_BIT((data), 37) << 5) | \
    (DBC_BIT((data), 38) << 6) | \
    (DBC_BIT((data), 39) << 7) \
) & DBC_3_STATE_OF_CHARGE_MASK)
static inline double dbc_3_state_of_charge_physical(const uint8_t data[static 8]) {
    const uint64_t raw = DBC_3_STATE_OF_CHARGE_RAW(data);
    const uint64_t value = raw;
    return (double)value * (0.5) + (0.0);
}

#define DBC_4_CELL_TEMPERATURE_MASK UINT64_C(0xFF)
#define DBC_4_CELL_TEMPERATURE_RAW(data) (( \
    (DBC_BIT((data), 40) << 0) | \
    (DBC_BIT((data), 41) << 1) | \
    (DBC_BIT((data), 42) << 2) | \
    (DBC_BIT((data), 43) << 3) | \
    (DBC_BIT((data), 44) << 4) | \
    (DBC_BIT((data), 45) << 5) | \
    (DBC_BIT((data), 46) << 6) | \
    (DBC_BIT((data), 47) << 7) \
) & DBC_4_CELL_TEMPERATURE_MASK)
static inline double dbc_4_cell_temperature_physical(const uint8_t data[static 8]) {
    const uint64_t raw = DBC_4_CELL_TEMPERATURE_RAW(data);
    const uint64_t value = raw;
    return (double)value * (1.0) + (-40.0);
}

Decode DBC signals from a raw CAN payload

Enter payload bytes in capture order. The grid uses DBC sawtooth addressing: byte 0 contains bit numbers 7 through 0, with the most significant bit drawn on the left. Select any square to inspect its absolute bit number, value and signal membership.

For Intel, the start bit is the least significant bit of the signal. Each next bit increases the absolute bit number. For Motorola, the start bit is the most significant bit. Walk toward bit 0, then continue at bit 7 of the next byte. A signed signal uses two’s complement at the declared signal width.

The raw decimal and hex values preserve all 64 bits. Scaled physical values use double precision. The C99 output contains masks and portable per-bit extraction for payloads with the entered minimum length. Check frame ID, DLC and signal multiplexing in the calling code.

Formulas

  • Physical = signed or unsigned raw value × factor + offset
  • Signed negative = unsigned raw − 2^length when its high bit is set

Worked example

For bytes 0A 2C, a 16-bit Intel signal at start bit 0 yields 0x2C0A = 11,274. A 16-bit Motorola signal at start bit 7 yields 0x0A2C = 2,604. The same two bytes produce different values because of byte order.

Frequently asked questions

Which Motorola start-bit convention is supported?

Use the DBC convention where the start bit is the most significant bit of the signal and within-byte bit indexes run from 7 to 0 on screen. Convert alternate editor numbering conventions before entering a signal.

Does this accept CAN FD?

This decoder accepts 8-byte Classic CAN and 16-byte CAN FD payload examples. The latter displays a 16-row, 128-bit grid.

How do I decode a negative pack current?

Choose Signed, enter the scale and offset from your DBC, and use the signal width as declared. For example, an 8-bit raw 0xF1 represents −15 before scaling.