A comprehensive IEEE 754 Floating Point Converter built with Java Converts any positive or negative number (integer or floating) into its 32-bit IEEE 754 binary and hexadecimal form — with step-by-step explanations.
This Java-based tool allows students and professionals to understand how floating-point numbers are represented in IEEE 754 single-precision (32-bit) format. It not only provides the final binary result but also walks you through every computational step:
- ✅ Conversion of integer and fractional parts to binary
- ✅ Normalization of binary number
- ✅ Calculation of biased exponent
- ✅ Mantissa extraction and rounding (round-to-nearest-even)
- ✅ Generation of 32-bit binary and hexadecimal output
- ✅ Verification using Java’s built-in
Float.floatToIntBits()
| Feature | Description |
|---|---|
| 🎯 Universal Input | Accepts any decimal value — integer, floating, positive, or negative. |
| 📊 Step-by-Step Conversion | Displays every IEEE 754 calculation step in an easy-to-read format. |
| ⚙️ Accurate Rounding | Implements IEEE’s Round to Nearest Even rule. |
| 🧠 Educational Design | Ideal for students learning number systems and floating-point standards. |
| 💻 Cross-Platform | Runs perfectly on Windows, macOS, and Linux using any Java-supported IDE. |
The program performs these steps automatically once you enter a number:
- Sign Detection: Determines the sign bit (1 for negative, 0 for positive).
- Integer Conversion: Converts the integer part of the number into binary.
- Fractional Conversion: Converts the fraction by multiplying by 2 and capturing integer parts.
- Normalization: Adjusts the binary number to scientific notation form (1.x × 2^E).
- Exponent Calculation: Adds 127 to the exponent (biasing).
- Mantissa Extraction: Captures 23 bits after the binary point.
- Rounding: Applies round-to-nearest-even rule for precision.
- Final Output: Displays 32-bit IEEE 754 representation (binary + hexadecimal).
IEEE754Converter-Java/
│
├── src/
│ └── IEEE754Converter.java # Main program file
│
├── README.md # Project documentation (this file)
├── .gitignore # Ignore compiled & IDE files
└── LICENSE # MIT License for open sharing- Install the Java Extension Pack from VS Code Marketplace.
- Open the folder
IEEE754Converter-Javain VS Code. - Open the file
IEEE754Converter.java. - Press
Ctrl + F5(or click “Run Java”). - Enter any number, e.g.
-3105.8565, and view the detailed conversion output.
- Open IntelliJ →
File > New > Project from Existing Sources - Select the folder
IEEE754Converter-Java - Mark
srcas a Source Root - Right-click
IEEE754Converter.java→ Run 'IEEE754Converter.main()'
- Create a New Java Project named
IEEE754Converter-Java. - Copy
IEEE754Converter.javainto thesrcfolder. - Right-click the file → Run As → Java Application.
If you have JDK installed:
cd path/to/IEEE754Converter-Java/src
javac IEEE754Converter.java
java IEEE754ConverterEnter a number: -3105.8565
Sign bit = 1
Integer binary = 110000100001
Fractional binary = .1101101101...
Normalized form = 1.10000100001110110110100 × 2^11
Exponent (biased) = 138 (10001010)
Mantissa = 10000100001110110110100
Final 32-bit IEEE 754 = 11000101010000100001110110110100
Hexadecimal = 0xC5421DB4