Number Base Converter (Decimal to Binary, Octal, Hex)
Convert a decimal integer into binary, octal, and hexadecimal, with its exact bit length and whether it's a power of two.
- Binary
- 101010
- Octal
- 52
- Hexadecimal
- 2A
- Bits needed
- 6
- Power of two?
- No
How it works
Converting a decimal integer to another base repeatedly divides it by that base and records each remainder, starting with the least significant digit — the standard division-remainder algorithm every base conversion uses. This calculator applies it to base 2 (binary), base 8 (octal), and base 16 (hexadecimal, where the digits 10-15 are written A-F).
Bit length is the number of binary digits the value needs (a byte holds 8 bits, so anything from 128-255 needs exactly 8). A value is a power of two exactly when its binary form has a single '1' digit — a useful thing to notice in computing, since powers of two mark clean boundaries like memory sizes and array capacities.
FAQ
Why can't I type a hexadecimal or binary number as the input?
This calculator only accepts a plain decimal number, since a numeric input field can't accept the letters A-F that hexadecimal needs. Decimal-to-other-base is the more common direction people need (e.g. 'what is 255 in hex'), so that's the direction this covers.
Is there a limit on how large a number I can convert?
Yes — up to Number.MAX_SAFE_INTEGER (9,007,199,254,740,991). Beyond that, floating-point numbers can't represent every integer exactly, so the conversion could silently be off by more than rounding error.
Related calculators
- Percentage Calculator
- Quadratic Equation Solver
- GCD & LCM Calculator
- Circle Area & Circumference Calculator
- Right Triangle Calculator (Pythagorean Theorem)
- Ratio Simplifier
- Exponent & Root Calculator
- Oblique Triangle Solver (Law of Cosines)
- Distance, Midpoint & Slope Calculator
- Permutations & Combinations Calculator (nPr, nCr)
- Arithmetic & Geometric Sequence Calculator
- Regular Polygon Calculator
- Z-Score & Percentile Calculator
- Cubic Equation Solver
- Prime Factorization Calculator
- System of Linear Equations Solver (2 Equations)
- Half-Life Decay Calculator
- Vector Calculator (Dot Product, Cross Product, Angle)
- Ohm's Law Calculator
- Projectile Motion Calculator
- Matrix Determinant & Inverse Calculator (2x2 / 3x3)
- Ideal Gas Law Calculator (PV = nRT)
- Snell's Law Calculator (Refraction Angle)
- Wire Resistance Calculator
- Clock Angle Calculator
- Pythagorean Means Calculator (AM, GM, HM)
- Dice Probability Calculator
- Pythagorean Triple Generator
- Binomial Probability Calculator
- Torque Calculator
- Law of Sines Triangle Solver
- Modular Exponentiation Calculator
- Simple Pendulum Period Calculator
- Kinetic Energy Calculator
- Complex Number Calculator
- Circular Sector & Arc Length Calculator
- System of 3 Linear Equations Solver
- Reynolds Number Calculator
- Coulomb's Law Calculator
- Speed of Sound in Air Calculator
- Thin Lens Equation Calculator
- Centripetal Force Calculator
- Resistors in Series and Parallel Calculator
- RC Circuit Time Constant Calculator
- Escape Velocity Calculator
- Doppler Effect Calculator
- Birthday Paradox Calculator
- Ellipse Area, Circumference & Eccentricity Calculator
- Hyperbola Calculator
- Hooke's Law Spring Calculator
- Molarity (Molar Concentration) Calculator
- Momentum & Impulse Calculator
- Kepler's Third Law Orbital Period Calculator
- Triangle Area from Coordinates Calculator
- Beer-Lambert Law Absorbance Calculator
- LC Circuit Resonant Frequency Calculator