Convert a decimal fraction to hexadecimal by repeated multiplication by 16, with exact detection of repeating hex digits – the float notation used in some language literals.
Show calculation steps
Processed privately in your browser — nothing you paste is uploaded, logged or stored.
Multiplying into hex places
The fractional conversion algorithm in base 16: multiply the fraction by sixteen, the integer part (0–15, written 0–F) is the next digit, repeat with what remains. Termination follows the same law as binary — power-of-two denominators finish, everything else repeats forever — because 16 is 2⁴.
This page runs the multiplication exactly and marks repeating digits in parentheses, with truncation labelled honestly when your digit budget runs out first.
Worked example
Input: 10.25 Integer: 10 → A Fraction: 0.25 × 16 = 4.0 → digit 4, remainder 0 Result: A.4 (terminates immediately)
Where repeats bite
Decimal 0.1 becomes 0.1(9) in hex — a 1 then 9 recurring — the same non-termination that afflicts it in binary, viewed four bits at a time. Any financial or measurement value with tenths shares the fate, which is the underlying reason such quantities are stored as scaled integers in serious systems.
Uses in practice
Preparing exact hex float literals, documenting fixed-point constants for firmware, cross-checking mantissa values, and teaching the terminate-or-repeat rule with a base large enough to keep examples short — four bits per digit means hex expansions are a quarter the length of their binary twins.
Precision and privacy
Exact rational arithmetic under a display budget you control; repeats detected by remainder recurrence, never inferred from digit patterns. All computation is in-browser and unrecorded.
How to use the Decimal Fraction to Hex Converter
- Enter a decimal value with a fractional part, such as 10.25.
- Set the maximum fraction digits.
- Click "Convert to hex".
- Repeating hex digits are shown in parentheses when the expansion never ends.
Frequently asked questions
How does the fractional part become hex digits?
Multiply by 16 repeatedly; each integer part produced (0-15 → 0-F) is the next digit. 0.25 × 16 = 4.0, so 10.25 = A.4 – terminating immediately.
Which decimal fractions terminate in hex?
Exactly the ones that terminate in binary – those whose reduced denominator is a power of two – because 16 is itself 2⁴. Decimal 0.1 therefore repeats in hex as well: it converts to 0.1(9), the digit 9 recurring forever, which the tool derives by exact remainder tracking.
Why would I want hex fractions at all?
They are the compact form of binary fractions: one hex digit is four binary places. Documentation for fixed-point hardware and float mantissas often uses hex fractions precisely for that density.
What does the precision setting do?
Caps how many hex places are printed. Detection of repeats is exact regardless; if the value neither ends nor cycles within the cap, the output is marked truncated rather than passed off as complete.
Is A.4 uppercase or a.4 lowercase – which is right?
Both denote the same value; the uppercase toggle exists to match your style guide. The radix point reads the same either way.
Can I feed the result into the Hex Fraction to Decimal page?
Yes – the two are exact inverses for terminating values, and round-tripping is a good self-check. Repeating results necessarily round-trip only to the digits displayed.
Is my value processed locally?
Yes. Exact rational arithmetic in the page; nothing transmitted or kept.