Hex Converter

Convert between hexadecimal, decimal, binary, octal, text, and floating-point numbers. Supports IEEE 754 formats.

Converting...
Conversion Results
Hexadecimal:
-
Decimal:
-
Binary:
-
Octal:
-
Text:
-
Floating-Point:
-

Hexadecimal Reference

Hexadecimal (base-16) is a numeral system that uses 16 distinct symbols: 0-9 to represent values 0-9, and A-F to represent values 10-15. It's widely used in computing as a human-friendly representation of binary data.

Hex Decimal Binary Hex Decimal Binary
0 0 0000 8 8 1000
1 1 0001 9 9 1001
2 2 0010 A 10 1010
3 3 0011 B 11 1011
4 4 0100 C 12 1100
5 5 0101 D 13 1101
6 6 0110 E 14 1110
7 7 0111 F 15 1111

Note: Hexadecimal is particularly useful in computing because it can represent every byte (8 bits) as two consecutive hexadecimal digits, making it much easier for humans to read and understand binary data.

IEEE 754 Floating-Point Reference

IEEE 754 is the technical standard for floating-point computation established in 1985. It defines formats for representing floating-point numbers and special values like infinity and NaN (Not a Number).

Format Bits Sign Bits Exponent Bits Mantissa Bits Exponent Bias Range Precision
Single Precision 32 1 8 23 127 ±1.18×10-38 to ±3.4×1038 ~7 decimal digits
Double Precision 64 1 11 52 1023 ±2.23×10-308 to ±1.80×10308 ~15 decimal digits

Note: The value of a floating-point number is determined by: (-1)sign × 2(exponent - bias) × 1.mantissa

Special Values

Value Single Precision (Hex) Double Precision (Hex) Description
Positive Zero 00000000 0000000000000000 +0.0
Negative Zero 80000000 8000000000000000 -0.0
Positive Infinity 7F800000 7FF0000000000000 +∞
Negative Infinity FF800000 FFF0000000000000 -∞
NaN (Quiet) 7FC00000 7FF8000000000000 Not a Number (quiet)
NaN (Signaling) 7F800001 7FF0000000000001 Not a Number (signaling)

Understanding Hexadecimal Representation

Hexadecimal (base-16) is a numerical system that uses 16 symbols: 0-9 to represent values 0-9, and A-F to represent values 10-15. It's widely used in computing because:

  • It's more compact than binary representation
  • It easily converts to and from binary (each hex digit represents 4 bits)
  • It's human-readable compared to long strings of binary digits
  • It's commonly used to represent memory addresses and binary data

Technical Example: The hexadecimal value "1A3F" can be converted to:

  • Decimal: 6719 (1×4096 + 10×256 + 3×16 + 15)
  • Binary: 0001 1010 0011 1111
  • Octal: 15077

Technical Note: Floating-point numbers have limited precision and can represent only a finite set of real numbers. Rounding errors are common in floating-point arithmetic.

About Floating-Point Conversion

Floating-point conversion involves translating between the hexadecimal representation of a floating-point number and its decimal value according to the IEEE 754 standard. This is essential for low-level programming, data analysis, and scientific computing.

How to Use This Tool

1

Select the "Float ↔ Hex" tab for floating-point conversion.

2

Choose between single precision (32-bit) or double precision (64-bit).

3

Enter a floating-point number to convert to hexadecimal, or enter hexadecimal to convert to a floating-point number.

4

Click the appropriate convert button or let the real-time conversion do the work.

5

View the detailed IEEE 754 representation in the results section.

Common Uses of Floating-Point Conversion

  • Low-level programming and debugging
  • Scientific computing and data analysis
  • Embedded systems development
  • Reverse engineering binary data
  • Understanding floating-point precision issues
  • Data serialization and deserialization
  • Computer graphics and game development

IEEE 754 Floating-Point Format

The IEEE 754 standard defines how floating-point numbers are represented in binary. Each number consists of three parts:

  • Sign bit: Determines if the number is positive (0) or negative (1)
  • Exponent: Stored as a biased integer (actual exponent = stored exponent - bias)
  • Mantissa (Significand): The fractional part of the number, with an implied leading 1 (for normalized numbers)

Technical Example: The number -118.625 in single-precision format:

  • Sign bit: 1 (negative)
  • Exponent: 133 (10000101 in binary)
  • Mantissa: 11011010100000000000000
  • Hexadecimal representation: C2ED4000

Developer Tips

  • Always consider floating-point precision limitations
  • Use double precision for financial calculations
  • Test edge cases: NaN, infinity, denormalized numbers
  • Be aware of rounding errors in floating-point arithmetic
  • Validate inputs when converting between formats

Floating-Point Precision Issues

Floating-point numbers have limited precision and can lead to unexpected results:

Calculation Expected Actual (Float)
0.1 + 0.2 0.3 0.30000000000000004
1.0 - 0.9 0.1 0.09999999999999998
0.1 * 0.1 0.01 0.010000000000000002

These precision issues occur because many decimal fractions cannot be represented exactly in binary floating-point format.