Binary to Hexadecimal Converter

Convert binary numbers (base‑2) — both integer and fractional — to hexadecimal (base‑16). See 4‑bit grouping, detailed step‑by‑step breakdown, and decimal approximation.

Enter a binary string consisting of '0', '1' and at most one decimal point. Total digits (excluding point) ≤ 64. Supports fractions.
1010₂ → A₁₆
11111111₂ → FF₁₆
110110.011₂ → 36.6₁₆
101011110011₂ → AFC₁₆
0.101₂ → 0.A₁₆
1011.1010₂ → B.A₁₆
111100001111.0001₂ → F0F.1₁₆
Privacy first: All conversions are performed locally in your browser. No data is transmitted or stored.

Why Binary to Hexadecimal with Fractional Support?

Binary is the native language of computers, but real‑world numbers often include fractional parts (e.g., 10.101₂ = 2.625 decimal). Hexadecimal provides a compact, human‑readable representation where every 4 bits (a nibble) maps to a single hex digit — this rule applies to both integer and fractional parts. Converting fractional binary to hex is essential for digital signal processing, fixed‑point arithmetic, and understanding how computers store floating‑point numbers.

Important distinction: This converter handles fixed‑point binary fractions (e.g., 1101.0110₂). It does not directly convert IEEE 754 floating‑point representations (like 0x40490FDB for π) — that would require interpreting the bit pattern as a sign, exponent, and mantissa.

Conversion principle for fractional binary:

Binary: 1011 . 0110 → Hex: B . 6 → 0xB.6

Integer part grouped from right; fractional part grouped from left, trailing zeros added as needed.

Conversion Algorithm for Floating‑Point Binary

Our converter follows a robust algorithm that handles both whole numbers and fractions:

  1. Validate input: only characters '0', '1', and at most one '.' (decimal point). Total binary digits (excluding dot) ≤ 64.
  2. Split into integer and fractional parts (default integer = "0", fraction = "" if missing).
  3. Integer part: Pad on the left with zeros to make length a multiple of 4. Split into 4‑bit groups from left, convert each to hex digit using binary‑hex table.
  4. Fractional part: Pad on the right with zeros to make length a multiple of 4. Split into 4‑bit groups from left, convert each group to hex digit.
  5. Combine integer hex string and fractional hex string (if fraction exists, prepend '.'). Prefix with '0x'.
  6. Decimal approximation: compute integer value + sum of bits in fraction (2-k) for reference.

This method guarantees exact conversion for binary numbers with finite binary expansion. For repeating binary fractions, the result is truncated to the given precision.

Real‑world Applications of Fractional Binary Conversion

  • Fixed‑point arithmetic: Embedded systems use fixed‑point binary numbers; hex representation simplifies debugging memory registers.
  • Digital audio / DSP: Sample values are often represented as binary fractions; hex dumps make them readable.
  • FPGA configuration: Fractional constants in VHDL/Verilog are written in hex for compactness.
  • Computer graphics: Normalized coordinates (0..1) in binary fractional form convert neatly to hex (e.g., 0.8₁₆ = 0.5 decimal).
  • Educational insight: Understand why 0.1₁₀ repeats in binary but may be exact in hex representation.

Binary‑Hex Reference Table (4‑bit nibbles)

0000 → 0 0001 → 1 0010 → 2 0011 → 3 0100 → 4 0101 → 5 0110 → 6 0111 → 7 1000 → 8 1001 → 9 1010 → A 1011 → B 1100 → C 1101 → D 1110 → E 1111 → F

Conversion Examples (Including Fractions)

Binary Integer group (left‑padded) Fraction group (right‑padded) Hexadecimal Decimal approx
110110.011 11 0110 → 36 011 → 6 0x36.6 54.375
0.101 0 → 0 1010 → A 0x0.A 0.625
1011.1010 1011 → B 1010 → A 0xB.A 11.625
1111.0001 1111 → F 0001 → 1 0xF.1 15.0625
1.011 0001 → 1 0110 → 6 0x1.6 1.375
Case Study: Fixed‑Point Constant in Embedded Code

An embedded engineer needs to store the value 3.8125 in a 16‑bit fixed‑point register (8 integer bits, 8 fractional bits). Binary representation: 11.1101₂. Converting to hex: integer part "11" padded to "0011" → 3, fractional part "1101" → D. The final constant becomes 0x3.D. Writing 0x3D in a C header file is compact and error‑free compared to binary literal. Our converter automates this translation and shows grouping steps, ensuring correctness.

Common Pitfalls in Binary to Hex Conversion

  • Missing or extra decimal point: Only one '.' is allowed. Input like "101.011.0" will be rejected.
  • Spaces or separators: Do not use spaces, commas, or underscores. Use pure binary digits and an optional single dot.
  • Leading zeros in fractional part: They are significant. "0.001" is not the same as "0.01". The tool preserves all bits.
  • Confusing fixed‑point with IEEE 754: This converter does not interpret the binary string as a 32‑bit or 64‑bit floating‑point pattern. For example, "01000000101000000000000000000000" as IEEE 754 single‑precision is 5.0, not "0x40A00000" in the sense of grouping nibbles (it is, but the interpretation differs). Use our dedicated IEEE 754 tool for that purpose.
  • Forgetting that hex digits A–F are uppercase: The tool outputs uppercase by default, which is standard. Lowercase is also acceptable in most systems.
  • Relying on decimal approximation for large integers: The decimal value shown may be rounded if the integer part exceeds 53 bits. Always trust the hex output for exact representation.

Frequently Asked Questions

Absolutely. The tool fully supports binary floating‑point numbers with a decimal point. It handles integer and fractional parts separately and combines them into a hexadecimal string (e.g., 101.0101₂ → 5.5₁₆).

The tool automatically appends trailing zeros to make the fractional part length a multiple of 4. For example, binary 0.101 becomes 0.1010 (pad right), which maps to 0xA. This preserves numeric accuracy because trailing zeros in binary fraction do not change the value.

The total number of binary digits (integer + fractional) cannot exceed 64. This provides up to 64 bits of precision, suitable for most fixed‑point and double‑precision mantissa exploration.

The decimal value is computed as integer part (base‑2 to base‑10) plus fractional contribution: sum(bit_i * 2-position). The result is a double-precision floating point number displayed with up to 10 significant digits. For integers longer than 53 bits, the decimal may be rounded — the hex value remains exact.

This version handles unsigned binary numbers (positive). For signed two's complement conversion, please refer to our dedicated signed binary converter (coming soon). However, you can still convert the absolute binary value and interpret sign separately.

Yes, use our Hex to Binary Converter which also supports fractional hexadecimal numbers. Both tools work seamlessly together.

Engineered for precision and education – This tool implements algorithms verified against IEEE 754 rounding rules and standard binary fraction theory. The conversion logic is peer‑reviewed by the GetZenQuery Tech  team and matches results from authoritative sources like Donald Knuth’s “Seminumerical Algorithms”. Updated April 2026.