Hex to Signed Integer Converter
Hex to Signed Integer Converter. Paste your value into Hex Input, pick a bit width, and the Hex to Signed Integer Converter instantly returns its Signed Decimal Output. If a print designer needs CMYK percentages instead of a hex code, the hex to cmyk converter handles the conversion instantly.
Paste a hex string, pick a width, and this hex to signed integer converter tells you the exact number those bits store, so you never have to guess whether E3A7 means 58,279 or -7,257. You get the signed integer a processor would read, with the two's complement working shown beside it.
How the Online Hex to Signed Integer Converter Works
The tool treats your input as a pattern of bits, not as a plain number. A signed integer reserves its leftmost bit to mark the sign, so the same hexadecimal value can mean two different things depending on how many bits the register holds. That is why the converter asks for a width before it answers. Enter a hex color into the hex to hsl converter to get its hue, saturation, and lightness values instantly.
Entering a Hexadecimal Value and Choosing the Bit Length
Type the digits into the input field, with or without a 0x prefix, then select 8, 16 or 32 bits. The bit length decides where the sign bit sits and how many hex digits make up a full value: two digits for 8 bits, four for 16 bits, eight for 32 bits. Press the convert button and the page returns the result along with each step of the working.
Reading Unsigned and Signed Results Side by Side
Every answer shows two interpretations of the same bits. The unsigned interpretation counts upward from zero, as unsigned integers do, while the signed one reserves the upper half of the range for negative numbers. Seeing both at once makes it obvious when B4 is 180 in one reading and -76 in the other, and which of the signed integers your data type really stores.
Uppercase and Lowercase Hex Digits
The letters A through F are accepted in uppercase or lowercase, so e3a7 and E3A7 give the same answer. The 16 hex digits map neatly onto base-16, and each digit stands for exactly four bits, which is why hex is the favourite notation for reading raw binary and writing bit masks.
Convert Hexadecimal to Signed Integer, Step by Step
Doing the hexadecimal to signed integer conversion by hand takes three moves, and the converter mirrors each one in its step-by-step output so you can verify the logic yourself. The fastest way to map a hex digit to its seven-segment display pattern is the hex to 7 segment converter.
Check the Most Significant Bit First
The most significant bit is the leftmost bit of the pattern. If it is 0, the value is non-negative and the signed result equals the plain hex to decimal answer. If it is 1, the value is negative. For hex, you can read this straight from the first digit: 8 through F means the sign bit is set, 0 through 7 means it is clear.
Subtract 2^n When the Sign Bit Is Set
For a negative pattern, take the binary representation as an ordinary base-10 number and subtract 2 raised to the number of bits:
$$\text{signed} = \text{unsigned} - 2^{n} \quad \text{when the sign bit is } 1$$
Here \(n\) is the width in bits. A positive pattern needs no subtraction at all. The same rule works as two's complement: invert every bit, add 1, and attach a minus sign to the magnitude you get.
Worked Example: E3A7 as a 16-bit Value
Take the 16-bit pattern E3A7 and run the three moves:
- The first digit is E, so the sign bit is 1 and the pattern is
1110 0011 1010 0111in binary. - As an unsigned number it equals 58,279 in decimal.
- Subtract \(2^{16} = 65{,}536\): \(58{,}279 - 65{,}536 = \mathbf{-7{,}257}\).
To double-check, invert the bits to 0001 1100 0101 1000, which is 1C58 or 7,256, and add 1. The magnitude is 7,257, so the answer is -7,257.
Two More Checks: an 8-bit Byte and a Signed 32-bit Integer
Switch the width and the same digits can change meaning. The 8-bit byte B4 is 180 unsigned, and \(180 - 256 = -76\). A longer pattern such as FFFFC7E1 read as a signed 32-bit integer is 4,294,952,929 unsigned, and \(4{,}294{,}952{,}929 - 4{,}294{,}967{,}296 = -14{,}367\). Eight hex digits fill all 32 bits, so nothing needs padding.
Signed Integer Ranges by Bit Length
The width you pick fixes the smallest and largest number a signed integer can hold. Half of the patterns are negative, which is why the negative side reaches one step further than the positive side.
| Width | Hex digits | Lowest signed value | Highest signed value |
|---|---|---|---|
| 8-bit | 2 | -128 | 127 |
| 16-bit | 4 | -32,768 | 32,767 |
| 32-bit | 8 | -2,147,483,648 | 2,147,483,647 |
| 64-bit | 16 | -9,223,372,036,854,775,808 | 9,223,372,036,854,775,807 |
Boundary Cases: 7F, 80, 7FFF and 8000
The boundary cases are where the sign flips. In 8 bits, 7F is the highest positive value, 127, and 80 is the lowest negative value, -128. In 16 bits the same jump happens between 7FFF (32,767) and 8000 (-32,768). Testing these edges is the quickest way to confirm that a converter respects the width you selected.
Why Negative Numbers Use Two's Complement
The converter applies two's complement, so any hex pattern with the top bit set comes out negative, as E3A7 becoming -7,257 shows. It also gives a single zero, which is why hardware and almost all programming languages adopted it for positive and negative numbers alike.
Reading a Freezer Log with the Hex to Signed Integer Converter
A cold-storage technician is reviewing the overnight log from a freezer controller. The controller writes one 16-bit word per reading, scaled in hundredths of a degree Celsius, and the 03:40 entry reads F8D3. The log viewer shows only hex, so the technician opens a hex converter to turn that word into a signed integer and learn whether the unit stayed cold enough.
They type F8D3, select 16 bits because the controller's register is two bytes wide, and press convert. The page reports the unsigned reading, 63,699, and then notices the first digit is F, so the sign bit is set. The hex to signed integer conversion subtracts 65,536 from the unsigned value and returns -1,837 as the signed result.
Since the sensor scales by 0.01 °C, the technician divides: \(-1{,}837 \times 0.01 = -18.37\,^{\circ}\text{C}\). That is colder than the -17.8 °C (0 °F) ceiling commonly used for frozen food storage, so the reading is within limits. Had they left the width on 8 bits, the tool would have flagged that the four-digit input overflows the setting, which is the cue to switch widths rather than trust the number.
The next row, F6B2, converts the same way to -2,382, or -23.82 °C. With both signed values decoded, the technician logs the 03:40 reading as compliant.
Hex Value Overflow, Padding and Input Rules
Most surprises come from the input rather than the arithmetic: the digits you enter and the width you pick decide the signed result the converter returns. Three rules cover nearly every case where an answer looks wrong.
Leading Zeros and Padded Input
If you type fewer digits than the chosen width needs, the tool treats the missing digits as leading zeros. A short entry is therefore padded on the left, which means F in 8-bit mode is 0F, or 15, and not -1. The signed integer is therefore 15, not -1; to get -1, enter FF. The padding always follows the bit-length you chose, never the length you typed.
Overflow When the Hex Is Wider Than the Bit Size
Input with more digits than the width allows causes overflow: the extra high bits do not fit. A strict converter reports the overflow as an error, while a typed cast in code silently drops the high bits. Watch for overflow whenever you paste a 32-bit value into an 8-bit or 16-bit setting, because the discarded bits change the sign as well as the size. Compilers also treat signed overflow as undefined behaviour, so the result of an overflow should never be relied on in production code.
Little-Endian Byte Order in Memory Dumps
Raw memory dumps from most desktop and embedded processors store the least significant byte first. The bytes A7 E3 in a dump therefore read as E3A7 once you restore the order. Reverse the byte pairs before converting: A7E3 gives -22,557 as a signed 16-bit value, while E3A7 gives -7,257.
Real-World Uses for Signed Integer to Hex Conversion
Hex conversion is routine wherever software meets raw data, and any good hex converter earns its place there. Typical conversion situations include:
- Embedded systems: microcontrollers report sensor readings as 8-bit or 16-bit hex words, and firmware engineers decode them to see temperature drops or negative offsets.
- Low-level programming: assembly and system-level C code constantly mixes hex constants with signed variables, and memory addressing often hides signed displacements.
- Networking: IP headers and binary payloads carry fields in hex, and several protocols define signed fields that must be decoded to interpret them.
- Debugging: reading a register dump in embedded software is far easier once each hex value is turned into the number the code expects, and the reverse signed integer to hex direction helps you build test inputs.
Signed Int Types in C, Python and JavaScript
To reproduce the converter's result in code, match the type to the width. In C, the pattern 0xE3A7 becomes -7,257 only when it is stored in a signed short (int16_t); in an unsigned type it stays 58,279. A signed char holds 8 bits and uint16_t holds the unsigned 16-bit form. Python needs an explicit step because its integers have no fixed width, for example int.from_bytes(bytes.fromhex("E3A7"), "big", signed=True). In JavaScript, (0xE3A7 << 16) >> 16 performs the sign extension. In MATLAB, a typecast such as typecast(uint16(hex2dec('E3A7')), 'int16') converts text from a bin file into the right type, and a long integer follows the same logic with more bits.
Related Hex, Decimal and Binary Converters
One conversion often leads to another. Use hex to decimal when only the unsigned value matters, hex to binary to see each bit of the sign pattern, decimal to hex and binary to hex to build the input in the first place, and an octal converter when a legacy system documents values in base 8. A general types converter that handles 64-bit values can also compare several formats at once.
Together these pages form a small toolkit: whichever hex converter you start from, the key habit is to name the width first, then decide whether the sign bit is set. A reliable conversion always follows from that order. Because the tool accepts hexadecimal data in either case and explains each stage, you can use it as a calculator for quick answers and as a reference when you must convert hexadecimal value to signed integer results by hand during a review.