Number System Conversions: Binary, Hex, and Scientific Notation Explained
Learn how to convert between binary, hexadecimal, decimal, and scientific notation. Essential for programmers, computer science students, and anyone working with large numbers.

A computer stores everything as 1s and 0s. Your phone has 8 billion transistors, each one either on or off. The number 65 in binary is 01000001. That same pattern also represents the letter "A" in ASCII. Every text message, photo, and video on your device is ultimately a sequence of binary digits that software interprets as meaningful data.
Number systems are not just academic. Programmers use hexadecimal daily for memory addresses, color codes, and debugging. Scientists use scientific notation to handle numbers ranging from the mass of an electron (9.109 x 10^-31 kg) to the number of stars in the observable universe (approximately 10^24). Fractions and decimals are two representations of the same value, and converting between them is a skill that shows up everywhere from cooking to engineering.
The Four Number Systems
Decimal (Base-10)
The system we use every day. Ten digits (0 through 9). Each position represents a power of 10. The number 345 means 3 x 100 + 4 x 10 + 5 x 1.
Binary (Base-2)
The language of computers. Two digits (0 and 1). Each position represents a power of 2. The binary number 1011 means 1 x 8 + 0 x 4 + 1 x 2 + 1 x 1 = 11 in decimal.
Hexadecimal (Base-16)
The programmer's shorthand for binary. Sixteen digits (0 through 9, then A through F where A=10, B=11, C=12, D=13, E=14, F=15). Each position represents a power of 16. The hex number 2F means 2 x 16 + 15 = 47 in decimal.
Hex is used because every hex digit corresponds to exactly 4 binary digits (a nibble). Two hex digits make one byte. The binary number 11111111 is FF in hex, which is much easier to read and write.
Octal (Base-8)
Eight digits (0 through 7). Each position represents a power of 8. Less common today but still used in Unix file permissions (chmod 755). The octal number 17 means 1 x 8 + 7 = 15 in decimal.
Converting Between Systems
Decimal to Binary
Divide by 2 repeatedly, recording the remainders. Read the remainders from bottom to top.
Example: Convert 45 to binary
- 45 / 2 = 22 remainder 1
- 22 / 2 = 11 remainder 0
- 11 / 2 = 5 remainder 1
- 5 / 2 = 2 remainder 1
- 2 / 2 = 1 remainder 0
- 1 / 2 = 0 remainder 1
Reading bottom to top: 101101. So 45 in decimal = 101101 in binary.
Binary to Decimal
Multiply each digit by its positional power of 2 and sum.
Example: Convert 110101 to decimal 1x32 + 1x16 + 0x8 + 1x4 + 0x2 + 1x1 = 32 + 16 + 4 + 1 = 53.
Decimal to Hexadecimal
Divide by 16 repeatedly, recording remainders. For remainders 10 through 15, use A through F.
Example: Convert 255 to hex
- 255 / 16 = 15 remainder 15 (F)
- 15 / 16 = 0 remainder 15 (F)
Reading bottom to top: FF. So 255 in decimal = FF in hex.
Binary to Hexadecimal (and Back)
Group binary digits into groups of 4 (from right to left), then convert each group.
Example: Convert 10110011 to hex
- 1011 = B
- 0011 = 3
So 10110011 in binary = B3 in hex.
To convert hex to binary, reverse the process: each hex digit becomes 4 binary digits. B3 = 1011 0011.
Use our Binary Calculator for binary arithmetic and conversions, and our Hex Calculator for hexadecimal calculations.
Scientific Notation
Scientific notation expresses numbers as a coefficient (between 1 and 10) multiplied by a power of 10. It handles very large and very small numbers compactly.
Format: a x 10^n, where 1 <= a < 10 and n is an integer.
Examples
| Number | Scientific Notation | Application |
|---|---|---|
| 299,792,458 | 2.998 x 10^8 | Speed of light (m/s) |
| 0.000000000000000000000000001673 | 1.673 x 10^-27 | Mass of a proton (kg) |
| 6,022,000,000,000,000,000,000,000 | 6.022 x 10^23 | Avogadro's number |
| 0.000000005 | 5 x 10^-9 | Wavelength of X-ray (m) |
Converting to Scientific Notation
Large numbers: Move the decimal point left until one non-zero digit remains. The number of moves is the exponent.
45,000,000 = 4.5 x 10^7 (moved decimal 7 places left)
Small numbers: Move the decimal point right until one non-zero digit remains. The exponent is negative.
0.00032 = 3.2 x 10^-4 (moved decimal 4 places right)
E-Notation
In programming and calculators, scientific notation is often written with "e" or "E" instead of "x 10^":
4.5 x 10^7 = 4.5e7 3.2 x 10^-4 = 3.2e-4
Use our Scientific Notation Calculator to convert between standard and scientific notation, and our Big Number Calculator for arithmetic with extremely large values.
Decimal to Fraction Conversion
Every terminating or repeating decimal can be expressed as a fraction. The conversion method depends on the decimal type.
Terminating Decimals
Count the decimal places, then divide by the corresponding power of 10 and simplify.
0.75 = 75/100 = 3/4 0.125 = 125/1000 = 1/8 0.6 = 6/10 = 3/5
Repeating Decimals
For repeating decimals, use algebra. Let x equal the repeating decimal, multiply by a power of 10 to shift the decimal point, then subtract.
Example: Convert 0.333... to a fraction x = 0.333... 10x = 3.333... 10x - x = 3.333... - 0.333... = 3 9x = 3 x = 3/9 = 1/3
Example: Convert 0.7272... to a fraction x = 0.7272... 100x = 72.7272... 100x - x = 72 99x = 72 x = 72/99 = 8/11
Use our Decimal to Fraction Calculator for instant conversion, and our Fraction Calculator for fraction arithmetic.
Roman Numerals
Roman numerals use seven symbols: I (1), V (5), X (10), L (50), C (100), D (500), M (1,000).
Rules
- Symbols are added when written largest to smallest left to right: XVI = 10 + 5 + 1 = 16
- A smaller symbol before a larger one means subtraction: IV = 5 - 1 = 4, IX = 10 - 1 = 9
- Only powers of 10 (I, X, C) can be placed before a larger symbol for subtraction
- V, L, and D are never subtracted
- A symbol cannot appear more than 3 times in a row: III = 3, but 4 is IV not IIII
Common Roman Numerals
| Number | Roman | Number | Roman |
|---|---|---|---|
| 1 | I | 50 | L |
| 4 | IV | 100 | C |
| 5 | V | 400 | CD |
| 9 | IX | 500 | D |
| 10 | X | 900 | CM |
| 40 | XL | 1,000 | M |
| 49 | XLIX | 3,999 | MMMCMXCIX |
Use our Roman Numeral Converter to convert between Roman numerals and decimal numbers.
Real-World Scenarios
Scenario 1: Web Color Codes
Web colors use hexadecimal RGB values. Pure red is #FF0000, meaning:
- Red: FF = 255 (maximum)
- Green: 00 = 0
- Blue: 00 = 0
A medium gray color #808080:
- 80 in hex = 8 x 16 + 0 = 128 in decimal
- Each RGB channel is 128 out of 255, which is 50.2% intensity
Scenario 2: Memory Addresses in Debugging
A debugger shows a memory address as 0x7FFE4A3C. In decimal: 7 x 16^7 + F x 16^6 + F x 16^5 + E x 16^4 + 4 x 16^3 + A x 16^2 + 3 x 16 + C = 7 x 268435456 + 15 x 16777216 + 15 x 1048576 + 14 x 65536 + 4 x 4096 + 10 x 256 + 3 x 16 + 12 = 1,879,048,124 + 251,658,240 + 15,728,640 + 917,504 + 16,384 + 2,560 + 48 + 12 = 2,147,371,512
Programmers never do this conversion by hand. They read hex directly. But understanding the relationship helps you recognize patterns and estimate values.
Scenario 3: Scientific Data
A chemistry lab reports a measurement as 3.45 x 10^-5 moles. To convert to decimal: 0.0000345 moles. To express in micromoles: 3.45 x 10^-5 x 10^6 = 34.5 micromoles.
Scenario 4: Cooking with Fractions
A recipe calls for 0.375 cups of sugar. What measuring cup should you use?
0.375 = 375/1000 = 3/8. Use a 3/8 cup measure, or 1/4 cup plus 1/8 cup.
Common Mistakes
1. Reading binary remainders in the wrong order. When converting decimal to binary by repeated division, read the remainders from bottom to top (last remainder first), not top to bottom.
2. Forgetting that hex uses letters. Hex digits go 0-9 then A-F. The number 3F is not "thirty-seven" but 3 x 16 + 15 = 63 in decimal.
3. Misplacing the decimal in scientific notation. The coefficient must be between 1 and 10. 45 x 10^5 is not proper scientific notation. It should be 4.5 x 10^6.
4. Confusing the exponent sign. Large numbers have positive exponents. Small numbers (less than 1) have negative exponents. 0.0005 = 5 x 10^-4, not 5 x 10^4.
5. Not simplifying fractions. 75/100 is correct but 3/4 is the simplified form. Always reduce fractions to lowest terms.
External Research and Resources
- Khan Academy: Number Systems offers free video lessons on binary, hexadecimal, and octal number systems with practice exercises.
- NIST: SI Units and Scientific Notation provides the official guidance on scientific notation usage in scientific and technical publications.
- IEEE Standard for Floating-Point Arithmetic (IEEE 754) defines how computers represent real numbers using binary scientific notation, the foundation of all modern numerical computing.
People Also Ask
How do I convert decimal to binary?
Divide the decimal number by 2 repeatedly, recording the remainders. Read the remainders from bottom to top. For example, 45 divided by 2 gives remainders 1, 0, 1, 1, 0, 1. Reading bottom to top: 101101. So 45 decimal = 101101 binary. Use our Binary Calculator for instant conversion.
What is hexadecimal and why is it used?
Hexadecimal is a base-16 number system using digits 0-9 and letters A-F. It is used because each hex digit represents exactly 4 binary digits, making it a compact way to represent binary data. FF in hex equals 11111111 in binary and 255 in decimal. Programmers use hex for memory addresses, color codes, and data representation.
How do I convert a decimal to a fraction?
For terminating decimals, count the decimal places and divide by the corresponding power of 10. 0.75 = 75/100 = 3/4. For repeating decimals, use algebra: set x equal to the decimal, multiply by a power of 10 to shift the repeating part, subtract, and solve for x. Use our Decimal to Fraction Calculator for instant results.
What is scientific notation and when is it used?
Scientific notation expresses numbers as a coefficient (1 to 10) times a power of 10. It is used for very large or very small numbers. The speed of light is 2.998 x 10^8 m/s instead of 299,800,000. The mass of an electron is 9.109 x 10^-31 kg instead of 0.0000000000000000000000000000009109 kg.
Related Calculators
- Binary Calculator - Binary arithmetic and conversions
- Hex Calculator - Hexadecimal calculations and conversions
- Scientific Notation Calculator - Convert between standard and scientific notation
- Big Number Calculator - Calculate with extremely large numbers
- Decimal to Fraction Calculator - Convert decimals to fractions
- Fraction Calculator - Fraction arithmetic and simplification
- Roman Numeral Converter - Convert between Roman and decimal
- Scientific Calculator - Advanced mathematical calculations
- Number Sequence Calculator - Identify and generate number sequences
Related Articles

Statistics in Everyday Life: Why Standard Deviation and Probability Matter
Statistics shapes decisions from investing to medicine to polling. Learn the four concepts every adult should understand, with real 2026 examples and practical calculations.

Science Math: Quadratic Equations, Half-Life, Molarity, and Density Explained
Learn the four math concepts every science student needs: quadratic equations, radioactive half-life, solution molarity, and density. With real chemistry and physics examples.

Precision Math: Significant Figures, Rounding, Ratios, and Roots Explained
Learn significant figures rules per NIST, rounding methods including banker's rounding, ratio and proportion calculations, and square root estimation for science and engineering.