SENSOR Raw Binary Decoder

Binary Sensor Raw Value Decoder

Decode raw binary sensor data into a usable engineering value. Interpret the binary word as unsigned or signed two’s-complement data, then apply the sensor’s scale factor and offset.

Binary Sensor Data Signed / Unsigned Two’s Complement Scale Factor Engineering Value
Sensor Raw Value Decoder Raw × Scale + Offset
Enter the complete raw binary word returned by the sensor.
Choose how the raw sensor bits should be interpreted.
Multiplier specified by the sensor datasheet.
Value added after scaling.
Optional display unit such as °C, kPa, g or rpm.
Decoded Value = Raw Decimal × Scale Factor + Offset
The bit width is taken directly from the number of binary bits entered. In signed mode, the most-significant bit is interpreted as the two’s-complement sign bit.
Decoded Sensor Value
Engineering Value
Raw Decimal
Unsigned Decimal
Hexadecimal
Bit Width
Data Type
Sign Bit
Scale Factor
Offset
Normalized Binary Word
Decoding Formula

What Is a Binary Sensor Raw Value?

Digital sensors often return measurements as raw integer data rather than immediately providing a human-readable temperature, pressure, acceleration or other physical measurement. That raw sensor value may be stored in a register, transmitted through a digital interface or embedded inside a packet.

The raw value frequently needs to be interpreted as an unsigned or signed binary integer and then transformed using a scale factor, sensitivity or offset documented by the sensor manufacturer.

How the Binary Sensor Raw Value Decoder Works

The decoder performs the process in two stages. First, the entered binary word is converted into its numerical raw value. Second, the supplied scale factor and offset are applied.

Step 1: Binary → Raw Decimal

Step 2: Engineering Value = Raw Decimal × Scale + Offset

This separation is important because the same binary bits can represent different numerical values depending on whether the sensor uses unsigned or signed two’s-complement coding.

Binary Sensor Decoding Formula

Many sensor datasheets use a linear conversion equation that can be represented in the following general form:

Physical Value = Raw Value × Scale Factor + Offset

For example, suppose a sensor returns raw decimal value 250 and specifies a scale of 0.1 °C per count.

250 × 0.1 = 25 °C

If the datasheet also specifies an offset, that value is added after the scale multiplication.

Signed Binary Sensor Data

Sensors that measure quantities capable of becoming negative commonly use signed numerical formats. Temperature, acceleration, angular velocity and magnetic-field sensors are common examples.

A very common representation is two’s complement. In an N-bit two’s-complement word, the highest bit indicates the negative range when it is set.

8-bit signed range: -128 through +127

16-bit signed range: -32768 through +32767

Unsigned Binary Sensor Data

Unsigned sensor data uses every available bit for magnitude and cannot directly represent negative raw values.

Bit Width Unsigned Range Signed Two’s-Complement Range
8-bit 0 to 255 -128 to 127
12-bit 0 to 4095 -2048 to 2047
16-bit 0 to 65535 -32768 to 32767
24-bit 0 to 16777215 -8388608 to 8388607

Signed Sensor Raw Value Example

Consider this 8-bit binary sensor word:

11110110

As an unsigned value it equals decimal 246. As an 8-bit two’s-complement value it represents -10.

Unsigned interpretation: 246

Signed interpretation: 246 – 256 = -10

If the scale factor is 0.5 °C per count:

Decoded Value = -10 × 0.5 = -5 °C

Unsigned Sensor Raw Value Example

Suppose an unsigned 12-bit pressure sensor returns:

100111000100

This binary number is decimal 2500.

If the documented scale is 0.02 kPa per count:

2500 × 0.02 = 50 kPa

No signed conversion is applied because the raw sensor format is unsigned.

Sensor Scale Factor

A sensor scale factor describes how much physical quantity corresponds to one raw digital count. It may also be called sensitivity, gain, resolution or conversion factor depending on the manufacturer and sensor type.

Scale: 0.01 °C/count

Raw: 2534

Decoded: 25.34 °C

The correct scale must come from the sensor documentation. This calculator cannot infer it automatically from the binary bits.

Sensor Offset

Some linear sensor conversions require an offset in addition to multiplication.

Physical Value = Raw × Scale + Offset

For example:

Raw: 500

Scale: 0.1

Offset: -40

Result: 500 × 0.1 – 40 = 10

The offset can be positive, negative or zero depending on the sensor’s documented transfer equation.

Binary Sensor Data to Hexadecimal

Sensor registers and datasheets commonly display raw values in hexadecimal notation. The decoder therefore also reports the hexadecimal representation of the entered binary word.

Binary: 11110110

Hex: 0xF6

Binary and hexadecimal are simply different ways of displaying the same raw bit pattern.

8-Bit Sensor Raw Values

An 8-bit sensor word contains 256 possible binary patterns.

Unsigned: 00000000 to 11111111 = 0 to 255

Signed: -128 to +127

The interpretation depends entirely on the data format specified in the sensor datasheet.

16-Bit Sensor Raw Values

Sixteen-bit sensor output is very common because it offers 65,536 possible raw bit patterns and fits naturally into two-byte registers.

Unsigned: 0 to 65535

Signed: -32768 to 32767

Accelerometers, gyroscopes, magnetic sensors, ADC measurements and industrial instruments frequently expose 16-bit measurement values.

Temperature Sensor Raw Value Example

Assume a signed 16-bit temperature register returns a decimal raw value of -300 and the datasheet specifies 0.01 °C per count.

Temperature = -300 × 0.01

= -3 °C

The binary decoder first determines that the raw register represents -300 before applying the temperature scale.

Accelerometer Raw Data Example

An accelerometer might return signed raw acceleration counts. If one raw count represents 0.001 g, then:

Raw: -750

Scale: 0.001 g/count

Acceleration: -0.75 g

The negative result represents direction relative to the sensor axis rather than an invalid measurement.

Pressure Sensor Raw Data Example

Pressure sensors commonly use unsigned measurements because the raw pressure quantity is usually non-negative across the supported range.

Raw: 12500

Scale: 0.01 kPa/count

Pressure: 125 kPa

The exact relationship varies by sensor; some pressure sensors instead use a minimum/maximum calibration mapping rather than a simple scale and offset.

Binary Sensor Data from I2C and SPI

Many digital sensors send raw measurements through I2C or SPI. Those communication protocols transport bytes, but the sensor datasheet defines how the bytes combine into the final measurement word.

This calculator assumes that the user already has the correctly assembled binary sensor value. It does not reorder I2C or SPI bytes automatically.

That keeps the page focused on raw sensor-value interpretation instead of repeating the separate byte-order and data-frame tools already available on BinaryCon.

Sensor Raw Value vs Register Scaling

The Binary Sensor Raw Value Decoder and Binary Register Scaling Calculator serve related but different purposes.

Tool Main Input Main Purpose
Binary Sensor Raw Value Decoder Actual binary sensor word Interpret signed/unsigned sensor bits and decode physical value
Binary Register Scaling Calculator Register/scaling parameters Apply register-value scaling relationship

This sensor decoder explicitly performs the binary and signed-number interpretation before scaling.

Sensor Raw Value vs ADC Binary Code

The ADC Binary Code Calculator predicts the digital code produced by an ideal ADC from a known input voltage. A sensor raw-value decoder starts from an already available digital sensor word and interprets what that word means.

ADC Binary Code Calculator: Voltage → Binary ADC Code

Sensor Raw Value Decoder: Binary Sensor Code → Engineering Measurement

Why Sensor Datasheets Matter

Raw binary data does not contain enough information by itself to determine the correct physical units, scaling formula or signedness. Those properties are defined by the device manufacturer.

Before decoding real sensor measurements, confirm the bit width, signed or unsigned encoding, scale factor, offset, byte order and measurement units in the sensor datasheet.

Important Binary Sensor Raw Value Notes

Important: this calculator starts from an already assembled binary sensor word.

The number of entered bits determines the raw word width.

Unsigned mode interprets the binary sequence as a normal positive base-2 integer.

Signed mode uses two’s-complement interpretation.

In signed mode, a most-significant bit of 1 indicates a negative two’s-complement value.

Decoded sensor value equals raw decimal value multiplied by the scale factor, then plus the offset.

The scale factor and offset must come from the sensor specification or calibration data.

The engineering-unit field changes only the displayed unit label; it does not modify the calculation.

This calculator does not reorder bytes, decode floating-point sensor registers, determine sensor calibration automatically or identify the sensor model.

Always confirm signedness, byte order, scale and units from the manufacturer’s datasheet before using a decoded value in an engineering application.

Binary Sensor Raw Value Decoder FAQs

What does the Binary Sensor Raw Value Decoder do?
It converts a raw binary sensor word into a decimal value, optionally interprets it as signed two’s-complement data, and applies a scale factor and offset to produce an engineering measurement.
What is sensor raw data?
Raw sensor data is the unscaled numerical value produced or transmitted by a sensor before conversion into units such as degrees Celsius, pressure, acceleration or other engineering quantities.
How do I decode a binary sensor value?
Determine whether the raw word is signed or unsigned, convert the binary bits to the correct decimal value, then apply the conversion formula specified by the sensor manufacturer.
How does signed sensor data work?
Many sensors use two’s-complement encoding. When the most-significant bit is 1, the raw N-bit word represents a negative value according to two’s-complement rules.
What does scale factor mean?
The scale factor is the amount of engineering quantity represented by one raw sensor count. For example, a scale of 0.01 °C/count means raw value 2500 corresponds to 25 °C before any offset.
What does sensor offset mean?
Offset is a value added after scaling. A conversion may therefore use raw × scale + offset.
Can this decode negative temperature sensor values?
Yes, when the sensor uses two’s-complement signed raw data. Select Signed Two’s Complement and enter the complete binary word.
Does this calculator know my sensor’s scale automatically?
No. Scale and offset are device-specific and must be obtained from the sensor datasheet or calibration information.
Does the unit field affect the mathematics?
No. It is only a display label for the calculated engineering value.
Does this tool handle sensor byte order?
No. The entered binary value should already be assembled in the correct bit order. Byte-order conversion is a separate operation.
Scroll to Top