Hex converter

Batch conversion

One value per line. Blank lines are skipped. Up to 200 values.

Enter values, then select Convert.

Hex to decimal, and back.Integers, IEEE 754 floats and device byte order.

Input format

Spaces and 0x are accepted. Short values are padded with zeros.

Examples

Compare all types

The table interprets fixed-width bytes and byte order, rather than plain number bases.

Data typeABCD (big-endian)DCBA (little-endian)BADCCDAB
UINT16
16-bit Unsigned Integer
-
-
-
-
INT16
16-bit Signed Integer
-
-
-
-
UINT32
32-bit Unsigned Integer
HEX:
40 48 F5 C3
DEC:
1078523331
HEX:
C3 F5 48 40
DEC:
3287631936
HEX:
48 40 C3 F5
DEC:
1212204021
HEX:
F5 C3 40 48
DEC:
4123213896
INT32
32-bit Signed Integer
HEX:
40 48 F5 C3
DEC:
1078523331
HEX:
C3 F5 48 40
DEC:
-1007335360
HEX:
48 40 C3 F5
DEC:
1212204021
HEX:
F5 C3 40 48
DEC:
-171753400
FLOAT32
32-bit Float
HEX:
40 48 F5 C3
DEC:
3.140000104904175
HEX:
C3 F5 48 40
DEC:
-490.564453125
HEX:
48 40 C3 F5
DEC:
197391.828125
HEX:
F5 C3 40 48
DEC:
-4.95020344754212e+32
UINT64
64-bit Unsigned Integer
HEX:
00 00 00 00 40 48 F5 C3
DEC:
1078523331
HEX:
C3 F5 48 40 00 00 00 00
DEC:
14120271646405165056
HEX:
00 00 00 00 48 40 C3 F5
DEC:
1212204021
HEX:
00 00 00 00 F5 C3 40 48
DEC:
4123213896
INT64
64-bit Signed Integer
HEX:
00 00 00 00 40 48 F5 C3
DEC:
1078523331
HEX:
C3 F5 48 40 00 00 00 00
DEC:
-4326472427304386560
HEX:
00 00 00 00 48 40 C3 F5
DEC:
1212204021
HEX:
00 00 00 00 F5 C3 40 48
DEC:
4123213896
FLOAT64
64-bit Float
HEX:
00 00 00 00 40 48 F5 C3
DEC:
5.32861326e-315
HEX:
C3 F5 48 40 00 00 00 00
DEC:
-24536736669821305000
HEX:
00 00 00 00 48 40 C3 F5
DEC:
5.989083625e-315
HEX:
00 00 00 00 F5 C3 40 48
DEC:
2.0371383365e-314
Byte orderKeep byte order
HEX40 48 F5 C3
DEC
3.140000104904175

Bytes

Select a byte to inspect its bits
16-bit registers
010x4048020xF5C3

Binary representation

IEEE 754 / FLOAT32
31Decoded bytes0
Sign0Exponent128Fraction4781507(1 + 4781507 ÷ 2²³) × 2⁽¹²⁸⁻¹²⁷⁾ = 3.140000104904175

How to convert

Read article: Float to Hex and Hex to Float: IEEE 754 and Modbus Byte Order

How to convert hex to decimal

Multiply each hex digit by its power of 16, starting at zero on the right, then add the results. To convert decimal to hex, divide by 16 repeatedly and read the remainders in reverse.

FF₁₆ = 15 × 16¹ + 15 × 16⁰ = 255₁₀

Common hex and decimal values

0 HEX0 DEC
1 HEX1 DEC
9 HEX9 DEC
A HEX10 DEC
F HEX15 DEC
10 HEX16 DEC
7F HEX127 DEC
80 HEX128 DEC
FF HEX255 DEC
100 HEX256 DEC
1000 HEX4096 DEC
FFFF HEX65535 DEC

FF → 255255 → 00 00 00 FF3F800000 → FLOAT32

Choose the number format

For FF → 255, select HEX and UINT16. For IEEE 754 bytes 3F800000 → 1, select HEX, FLOAT32 and ABCD. The same bytes can represent different values in different types.

What you can do

  • Convert decimal values to hex bytes, or decode hex bytes as decimal values.
  • Compare signed and unsigned 16-, 32- and 64-bit integers, FLOAT32 and FLOAT64.
  • Inspect byte order, 16-bit registers and binary fields.
  • Copy a result or compare all supported types in the results below.

Steps

  • 1. Select decimal or hexadecimal input.
  • 2. Enter a value and select its data type.
  • 3. Match the byte order to your device and read the result.
  • 4. Compare the results below. A dash means the value cannot be represented in that type.

Choose a conversion

TaskInput valueData typeByte orderResult
Hex to decimalFFUINT16AB255
Decimal to hex255UINT16AB00 FF
Hex to float3F800000FLOAT32ABCD1
Signed integerFFFFINT16AB-1

Choose INT/UINT to convert integer bases, or FLOAT32/FLOAT64 to decode floating-point bytes.

Accepted input

  • Use whole numbers for integer types. FLOAT32 and FLOAT64 accept finite decimal values and scientific notation.
  • Use digits 0–9 and A–F. Spaces and 0x prefixes are accepted, for example 0x3F800000 or 3F 80 00 00.
  • Short hex values are padded with leading zeros. Invalid characters and values wider than the selected type are rejected.

Choose a data type

IntegersUINT types are unsigned; INT types use two's complement. FFFF is 65535 as UINT16 and -1 as INT16. Short input is zero-padded: FF becomes 00FF and is 255 as INT16.

IEEE 754 floatsFLOAT32 uses 1 sign bit, 8 exponent bits and 23 fraction bits; FLOAT64 uses 1, 11 and 52. HEX bit patterns can also represent signed zero, infinity and NaN.

An out-of-range value shows an error above and a dash in the comparison results.

Match the byte order

  • ABCD: keep the byte order. Example: 12 34 56 78.
  • DCBA: reverse all bytes. Example: 78 56 34 12.
  • BADC: swap bytes in each 16-bit register. Example: 34 12 78 56.
  • CDAB: swap the two registers in each four-byte group. Example: 56 78 12 34.

16-bit values use AB or BA. For 64-bit values, CDAB swaps registers within each four-byte group. Check the device manual for its register order.

Common conversion questions

How do I convert hex to decimal?

Select HEX and an integer type: FF with UINT16 gives 255. Use UINT32 or UINT64 for larger unsigned values. IEEE 754 conversion interprets floating-point bits rather than just changing the number base.

How do I decode an IEEE 754 float?

Select HEX, FLOAT32 and ABCD. Enter 3F800000 to get 1. For a 64-bit double, select FLOAT64; 3FF0000000000000 is 1.

Why can FFFF mean -1?

INT16 treats FFFF as two's complement and returns -1; UINT16 returns 65535. FF is padded to 00FF and returns 255 for either 16-bit type.

How do BADC and CDAB differ?

BADC swaps bytes within each 16-bit register. CDAB swaps the two registers within each four-byte group. The order must match your device; byte order does not reverse the bits inside a byte.

Are 64-bit integer results exact?

This converter preserves every digit in the integer range. UINT64 accepts 0–18446744073709551615; INT64 accepts -9223372036854775808–9223372036854775807. Decimal integer input must use whole-number digits.

What happens to short hex values?

Leading zeros fill the selected width: FF becomes 00 FF for a 16-bit type. Spaces and 0x prefixes are accepted. Invalid characters and excess bytes are rejected.

Why does FLOAT32 change 3.14 slightly?

FLOAT32 stores the nearest representable binary value. 3.14 becomes bytes 40 48 F5 C3, representing 3.140000104904175. This is floating-point rounding.

Can I convert text or color codes here?

This tool converts numbers and their encoded bytes. It does not decode text encodings or convert RGB colors. Choose an integer or IEEE 754 type for register data.

Use with your device data

  • Decode Modbus register values
  • Check signed and unsigned PLC values
  • Inspect device parameter bytes
  • Compare protocol byte order
  • Check sampled numeric data
  • Read 16-bit register pairs
  • Compare integer and floating-point interpretations
  • Match different device byte orders
  • Decode sensor and transmitter readings
  • Check recorded hex values
Troubleshooting

Check the data type, byte order and scaling in the device manual. The same bytes can represent different values.

3F 80 00 00 → FLOAT32 / ABCD → 1

Read article