Decimal Base Converter
Convert fractions such as 0.1 to binary, octal and hex, with repeating digits and every step shown.
In other bases
Step by step
How computers store it (IEEE 754)
Floating-point numbers store a binary fraction rounded to a fixed number of bits. Here is how the number you entered is stored, and how far it is from the exact value.
Double precision (64-bit)
Single precision (32-bit)
Why 0.1 + 0.2 is not exactly 0.3
How to Use
Enter a number
Type the fraction you want to convert. The page opens with 0.1 already converted to binary. To turn a binary, octal or hex fraction into decimal, change the input base.
Choose the base and digits
Pick the base to convert to and how many digits to keep for fractions that never end (8, 16, 23, 32, 52 or any number). The error from cutting off is shown too.
Check the answer and the steps
Repeating digits are shown in parentheses. The tables below walk through multiplying the fraction by the base, dividing the whole-number part, and how the value is stored in IEEE 754.
What is the Decimal Base Converter?
A converter for fractions: decimal to binary, octal and hex, and binary, octal or hex fractions back to decimal. Numbers such as 0.1 that binary cannot represent exactly are shown with their repeating digits, such as 0.0(0011), along with the value and error after cutting off at the number of digits you choose. The step-by-step tables make it useful for computer science classes and exams. Calculations use exact fractions and run in your browser.
Features
- Repeating digitsFractions that never end are written like 0.0(0011), with the repeating part in parentheses.
- Cut-off and errorKeep 8, 16, 23, 32, 52 or any number of digits and see the difference from the exact value.
- Step-by-step tablesMultiply-and-take-the-integer steps, division for the whole-number part, and digit weights.
- IEEE 754 viewSingle and double precision bits, the stored value, and why 0.1 + 0.2 is not 0.3.
Use Cases
- Practicing base conversion for computer science exams
- Seeing what 0.1 looks like in binary
- Understanding floating-point errors such as 0.1 + 0.2
- Turning hex or octal fractions into decimal
- Estimating how many bits a fixed-point number needs
Related tools
For whole numbers in binary, octal, decimal and hex, with bit widths and two's complement, use the Number Base Converter. To convert text and character codes, try the ASCII Converter; for Unix time, the Unix Timestamp Converter.
FAQ
What is 0.1 in binary?
Why can’t binary represent some decimals exactly?
How do I convert a binary fraction to decimal?
How do hex and octal fractions work?
How many digits should I keep?
Why is 0.1 + 0.2 not exactly 0.3?
Can it convert numbers with a whole-number part, such as 12.375?
Can it convert negative numbers?
Is my input saved?
Updates to this tool
-
Improved
Decimal Base Converter has its own page again: convert fractions such as 0.1 to binary, octal and hex, with repeating digits and every step shown.
Feedback
Missing a feature, or getting a result that looks wrong? Let us know — we improve our tools based on your feedback.