Canmetry
Open workbench

The CAN signal calculator for DBC signals

Paste a payload, describe the signals the way your DBC does, and see every raw value, physical value and the exact bits each one uses. Edit a value and the payload follows.

DBC signal

Bytes separated by spaces, for example 00 00 40 1F

Signal definition

Raw range 0 to 65535

Bit layout

76543210
0
1
2
3
4
5
6
7
  • Engine_Speed
  • Coolant_Temp
  • Throttle_Pos
  • Gear
  • Click a bit to flip it. M and L mark the two ends of a signal.

Decoded values

SignalRaw valueHexPhysical valueUnit
Engine_Speed1F40hrpm
Coolant_Temp5Ah°C
Throttle_Pos80h%
Gear5h

How to use the CAN signal calculator

Four steps, and nothing leaves your browser.

  1. Describe the signal

    Pick the byte order and value type, then enter the start bit, length, factor, offset and unit exactly as your DBC lists them.

  2. Paste the payload

    Enter the data bytes of one frame in hex. Spaces, commas and 0x prefixes are all fine, and CAN FD payloads of up to 64 bytes work.

  3. Read the result

    The table gives the raw integer, its hex form and the physical value of each signal. The bit layout shows which bits each one occupies.

  4. Edit and write back

    Type a new raw or physical value, or click a bit, and the payload updates. Add more signals to see a whole message at once.

How a CAN signal value is calculated

A CAN frame carries only bytes. The signal definition says which bits to pick, in what order, and how to turn the resulting integer into an engineering value.

  1. 1. Pick the bits

    The start bit, length and byte order select a run of bits in the payload. Bit 0 is the least significant bit of byte 0.

  2. 2. Read the raw integer

    The selected bits are read as one integer. For a signed signal the top bit is the sign, so the integer is read as two's complement.

  3. 3. Scale to a physical value

    The raw integer is multiplied by the factor and the offset is added. The result is the value in the signal's unit.

# 0x1F40, factor 0.25, offset 0
raw = 0x1F40        # 8000
physical = raw * 0.25 + 0  # 2000
# 3000 rpm back to bytes
raw = round((3000 - 0) / 0.25)  # 12000
bytes = 0x2EE0                   # E0 2E, Intel

What changes for signed signals

A signed 12-bit signal covers -2048 to 2047. When its top bit is set, subtract 2^12 from the unsigned reading: 0xF9C is 3996 unsigned, and 3996 - 4096 gives -100.

Intel and Motorola byte order

A DBC start bit means something different for each byte order, and mixing them up is the usual reason a decoded value looks wrong.

Intel: start bit is the LSB

Bits are numbered from the least significant bit of byte 0 and the signal grows upward, crossing into the next byte once a byte is full. Little endian.

Motorola: start bit is the MSB

The start bit is the most significant bit. The signal runs down toward bit 0 of its byte, then jumps to bit 7 of the next byte. Big endian, written @0 in a DBC.

CAN signal terms explained

The vocabulary you meet in DBC files and CAN tools.

Signal
A named value packed into a frame, such as engine speed or a door-open flag. One frame usually carries several.
Message
One frame as a DBC describes it: an ID, a length and the signals it carries.
CAN ID
The identifier of a frame, 11 bits for standard and 29 bits for extended frames. It tells receivers which message they are looking at.
Payload and DLC
The payload is the data field of a frame. The DLC is its length code: 0 to 8 bytes on classic CAN, up to 64 bytes on CAN FD.
Start bit
Where the signal begins. For Intel it is the least significant bit, for Motorola the most significant bit.
Length
The number of bits the signal occupies, from 1 to 64.
Byte order
Intel (little endian, @1) or Motorola (big endian, @0). It decides how a signal that spans several bytes is assembled.
Raw value
The integer stored in the signal's bits, before any scaling.
Factor and offset
The linear scaling from raw to physical: physical = raw × factor + offset.
Physical value
The engineering value after scaling, in the signal's unit such as rpm or °C.
Signed and unsigned
Whether the raw value can be negative. Signed signals use two's complement.
Multiplexing
Some DBC signals only apply when a multiplexer signal has a given value. This calculator treats every signal as always present.

How a signal is defined in a DBC file

Every signal is one SG_ line. Read it left to right and you have every input the calculator asks for.

BO_ 416 EngineData: 8 ECU
 SG_ Engine_Speed : 16|16@1+ (0.25,0) [0|16383.75] "rpm" Gateway
PartMeaning
Engine_SpeedSignal name
16|16Start bit | length in bits
@1Byte order: 1 is Intel, 0 is Motorola
+Value type: + is unsigned, - is signed
(0.25,0)Factor and offset
[0|16383.75]Minimum and maximum physical value; informational, not used in the calculation
"rpm"Unit
GatewayReceiving node

The BO_ line above the signals gives the message ID and length, for example BO_ 416 EngineData: 8 ECU. A DBC stores the ID in decimal, so 416 is 0x1A0.

Three signals worked by hand

Load any of these into the calculator to follow the arithmetic.

@1+ 16|16 (0.25,0)

00 00 40 1F 00 00 00 00

Scaled speed

Intel, start 16, 16 bits. The bytes 40 1F read as 0x1F40, which is 8000 raw. At a factor of 0.25 that is 2000.

@0+ 7|12 (0.1,0)

12 34 00 00 00 00 00 00

Signal across a byte boundary

Motorola, start 7, 12 bits. All of byte 0 (12) and the top nibble of byte 1 (3) make 0x123, or 291. At a factor of 0.1 that is 29.1.

@1- 0|12 (0.1,0)

9C FF 00 00 00 00 00 00

Negative values

Intel, start 0, 12 bits, signed. The bytes 9C FF give 0xF9C, which is 3996 unsigned. The top bit is set, so subtract 4096 to get -100, or -10.0 at a factor of 0.1.

Common mistakes when decoding CAN signals

Almost every wrong value traces back to one of these.

  • Wrong byte order

    A Motorola start bit points at the most significant bit and an Intel one at the least significant bit. Entering a Motorola signal as Intel selects other bits and gives a believable but wrong number.

  • Flat bit numbers for Motorola

    Motorola bits are numbered inside each byte while the signal walks across bytes in network order. A tool that shows one flat bit index can disagree with the DBC start bit, so check the bit layout.

  • Ignoring the sign

    Reading a signed signal as unsigned turns -100 into 3996. When a value jumps to the top of its range, check the value type.

  • Forgetting the offset

    Temperatures are often stored as the value plus 40. Without the offset every reading is 40 degrees too high.

  • A payload that is too short

    A signal that reaches byte 9 cannot be read from an 8-byte payload. Check the DLC, since the message may be a CAN FD frame.

CAN signal calculator questions

What is the difference between raw and physical value?

The raw value is the integer sitting in the bits. The physical value is raw × factor + offset, which is what the DBC publishes as the engineering value, such as rpm or degrees Celsius.

Why does my value come out wrong?

The most common cause is the wrong byte order. A Motorola start bit points at the MSB, an Intel start bit at the LSB, so the same number selects different bits. Check signedness too: a set top bit is a negative number for a signed signal.

How do I read a signal that spans two bytes?

Pick the byte order from the DBC (@1 is Intel, @0 is Motorola) and enter the start bit exactly as the DBC lists it. The bit layout shows which bits of each byte are used, so you can check the signal covers the bytes you expect.

Does it support CAN FD payloads?

Yes. Paste up to 64 bytes. Signals up to 64 bits long are handled exactly, including values beyond 2^53 that plain JavaScript numbers would round.

Can I go from a physical value back to bytes?

Yes. Change the physical value and the calculator writes the nearest raw value into the payload, leaving every other bit alone. If the value falls outside what the signal can hold it is clamped and you are told.

Is anything uploaded?

No. The arithmetic runs in your browser, so the payload and definition never leave the page.

Does it handle multiplexed signals?

Not yet. Each signal is decoded as if it were always present. For a multiplexed message, enter only the signals that apply to the multiplexer value you are looking at.

How do I turn a physical value into a raw value?

Subtract the offset and divide by the factor, then round to the nearest integer: raw = round((physical - offset) / factor). Editing the physical value in the table does this and writes the bits into the payload.

How long can a signal be?

From 1 to 64 bits, as in the DBC format. The raw value is handled as an exact integer, so 64-bit signals do not lose precision.