Bookmarks    
nPr and nCr    
Random Number    
SD Calculator    
Sample Size    
Percent Error    
Density    
Molarity    
Molar Mass    
Ohm's Law    
Watts to Amps    
Voltage Drop    
Long Division    
Mixed Numbers    
Rounding    
Nth Root    
Exponents    
Half-Life    
Polar Form    
De Moivre    
3D Distance    
Point to Line    
Cross Product    
Determinant    
Sin Cos Tan    
Triangle Area    
Scale Factor    
Sector Area    
Ellipse Area    
Cube Volume    
Box Volume    
Sphere Volume    
Cone Volume    
Pipe Volume    
Time Duration    
Time Card    
Present Value    
Future Value    
Churn Rate    
A/B Test Calc    
SEO Traffic    
Ideal Weight    
Fat Intake    
Child Height    
Golf Handicap    
Heat Index    
Wind Chill    
Dew Point    
Download Time    
kWh to Cost    
AC Size (BTU)    
Heating Costs    
LED Savings    
Trip Gas Cost    
Tire Size    
Solar Output    
Solar Payback    
Battery Size    
Wall Area    
Gravel Needed    
Mortar Mix    
Slope Grade    
Curtain Size    
Soil Needed    
Sod Needed    
Ramp Length    
Blind Size    
Drain Slope    
Board Feet    
Heat Loss    
Furniture Fit    
Moving Boxes    
Plywood Cuts    
Shelf Sag    
   Add
Probability and random number calculators
Independent Events
Independent Events
Two Events Solver
Two Events Solver
Repeated Trials
Repeated Trials
Bayes' Theorem
Bayes' Theorem
Expected Value
Expected Value
Binomial Distribution
Binomial Distribution
nPr and nCr
nPr and nCr
Circular Permutation
Circular Permutation
With Repetition
With Repetition
Random Number
Random Number
Averages and statistics calculators
Average Calculator
Average Calculator
Mean Median Mode
Mean Median Mode
SD Calculator
SD Calculator
Quartiles & IQR
Quartiles & IQR
Frequency Table
Frequency Table
Correlation (r)
Correlation (r)
Normal Probability
Normal Probability
Z-Score Calculator
Z-Score Calculator
Confidence Interval
Confidence Interval
Sample Size
Sample Size
Mark & Recapture
Mark & Recapture
P-Value Calculator
P-Value Calculator
Percentage and ratio calculators
Percentage Calc
Percentage Calc
Percent Change
Percent Change
Percent Difference
Percent Difference
Percent Error
Percent Error
Ratio Calculator
Ratio Calculator
Discount Calculator
Discount Calculator
Sales Tax Calculator
Sales Tax Calculator
Margin Calculator
Margin Calculator
Speed calculators
Speed Calculator
Speed Calculator
Density and concentration calculators
Density
Density
Molarity
Molarity
Molar Mass
Molar Mass
Physics and electricity calculators
Ohm's Law
Ohm's Law
Watts to Amps
Watts to Amps
Resistor Colors
Resistor Colors
Voltage Drop
Voltage Drop
Unit conversion calculators
Weight Converter
Weight Converter
Shoe Size Converter
Shoe Size Converter
Integer and signed number calculators
Long Division
Long Division
LCM Calculator
LCM Calculator
GCF Calculator
GCF Calculator
Integer Calculator
Integer Calculator
Prime Factorization
Prime Factorization
Diophantine Solver
Diophantine Solver
Modulo Calculator
Modulo Calculator
Factor Calculator
Factor Calculator
Roman Numerals
Roman Numerals
Fraction, decimal and rounding calculators
Fraction Calculator
Fraction Calculator
Mixed Numbers
Mixed Numbers
Simplify Fractions
Simplify Fractions
Fraction to Decimal
Fraction to Decimal
Decimal to Fraction
Decimal to Fraction
Rounding
Rounding
Equation and inequality calculators
Linear Equation
Linear Equation
Linear Systems
Linear Systems
Quadratic Formula
Quadratic Formula
Absolute Value
Absolute Value
Quadratic Inequality
Quadratic Inequality
Polynomial calculators
Binomial Theorem
Binomial Theorem
Square root and nth root calculators
Simplify Radicals
Simplify Radicals
Nth Root
Nth Root
Exponent and logarithm calculators
Exponents
Exponents
Log Calculator
Log Calculator
Number of Digits
Number of Digits
Scientific Notation
Scientific Notation
Sci. Notation Math
Sci. Notation Math
Half-Life
Half-Life
Complex number calculators
Complex Numbers
Complex Numbers
Polar Form
Polar Form
De Moivre
De Moivre
Function and graph calculators
Slope Calculator
Slope Calculator
Linear Function
Linear Function
Direct & Inverse Variation
Direct & Inverse Variation
y = ax² Calculator
y = ax² Calculator
Distance Formula
Distance Formula
3D Distance
3D Distance
Section Formula
Section Formula
Point to Line
Point to Line
Lat/Long Distance
Lat/Long Distance
Complete the Square
Complete the Square
Circle Equation
Circle Equation
Conic Sections
Conic Sections
Polar Coordinates
Polar Coordinates
Sequence calculators
Arithmetic Sequence
Arithmetic Sequence
Geometric Sequence
Geometric Sequence
Fibonacci Sequence
Fibonacci Sequence
Recurrence Relation
Recurrence Relation
Vector calculators
Vector Calculator
Vector Calculator
Cross Product
Cross Product
Matrix calculators
Matrix Calculator
Matrix Calculator
Determinant
Determinant
Inverse Matrix
Inverse Matrix
Plane geometry calculators
Sin Cos Tan
Sin Cos Tan
Degrees ⇔ Radians
Degrees ⇔ Radians
a sin θ + b cos θ
a sin θ + b cos θ
Triangle Solver
Triangle Solver
Triangle Area
Triangle Area
Right Triangle
Right Triangle
Pythagorean Theorem
Pythagorean Theorem
Polygon Angles
Polygon Angles
Scale Factor
Scale Factor
Parallel Lines
Parallel Lines
Rectangle Area
Rectangle Area
Parallelogram Area
Parallelogram Area
Trapezoid Area
Trapezoid Area
Circle Calculator
Circle Calculator
Sector Area
Sector Area
Inscribed Angle
Inscribed Angle
Ellipse Area
Ellipse Area
Solid geometry calculators
Cube Volume
Cube Volume
Cube Surface Area
Cube Surface Area
Box Volume
Box Volume
Box Surface Area
Box Surface Area
Cylinder Volume
Cylinder Volume
Cylinder Surface
Cylinder Surface
Sphere Volume
Sphere Volume
Sphere Surface
Sphere Surface
Spherical Cap Volume
Spherical Cap Volume
Cap Surface Area
Cap Surface Area
Ellipsoid Volume
Ellipsoid Volume
Ellipsoid Surface
Ellipsoid Surface
Pyramid Volume
Pyramid Volume
Pyramid Surface
Pyramid Surface
Cone Volume
Cone Volume
Cone Surface Area
Cone Surface Area
Frustum Volume
Frustum Volume
Frustum Surface Area
Frustum Surface Area
Pipe Volume
Pipe Volume
Capsule Volume
Capsule Volume
Capsule Surface Area
Capsule Surface Area
Date and time calculators
Age Calculator
Age Calculator
Days Between Dates
Days Between Dates
Date Calculator
Date Calculator
Hours From Now
Hours From Now
Day of the Week
Day of the Week
Time Calculator
Time Calculator
Time Zone Converter
Time Zone Converter
Hours Calculator
Hours Calculator
Time Duration
Time Duration
Time Card
Time Card
Finance and economics calculators
Compound Interest
Compound Interest
Simple Interest
Simple Interest
Interest Calculator
Interest Calculator
TVM Calculator
TVM Calculator
Present Value
Present Value
Future Value
Future Value
ROI Calculator
ROI Calculator
IRR Calculator
IRR Calculator
Payback Period
Payback Period
Average Return
Average Return
GDP Calculator
GDP Calculator
Web marketing and ad metric calculators
CTR Calculator
CTR Calculator
Conversion Rate
Conversion Rate
CPC, CPM & CPA
CPC, CPM & CPA
ROAS Calculator
ROAS Calculator
Break-Even CPA
Break-Even CPA
LTV Calculator
LTV Calculator
CAC Calculator
CAC Calculator
Churn Rate
Churn Rate
A/B Test Calc
A/B Test Calc
A/B Sample Size
A/B Sample Size
SEO Traffic
SEO Traffic
Break-Even Point
Break-Even Point
Markup vs. Margin
Markup vs. Margin
CAGR Calculator
CAGR Calculator
Health and fitness calculators
BMI Calculator
BMI Calculator
Sleep Calculator
Sleep Calculator
Calorie Calculator
Calorie Calculator
BMR Calculator
BMR Calculator
TDEE Calculator
TDEE Calculator
Ideal Weight
Ideal Weight
Body Fat Calculator
Body Fat Calculator
Lean Body Mass
Lean Body Mass
Calories Burned
Calories Burned
Protein Intake
Protein Intake
Macro Calculator
Macro Calculator
Carb Calculator
Carb Calculator
Fat Intake
Fat Intake
Child Height
Child Height
Sports calculators
Golf Handicap
Golf Handicap
Pace Calculator
Pace Calculator
1RM Calculator
1RM Calculator
Target Heart Rate
Target Heart Rate
Weather calculators
Heat Index
Heat Index
Wind Chill
Wind Chill
Dew Point
Dew Point
Computer calculators
Base Converter
Base Converter
Subnet Calculator
Subnet Calculator
Download Time
Download Time
Household energy and budget calculators
Electricity Cost
Electricity Cost
kWh to Cost
kWh to Cost
Yearly kWh to Cost
Yearly kWh to Cost
AC Size (BTU)
AC Size (BTU)
AC Running Cost
AC Running Cost
Heating Costs
Heating Costs
Gas vs Electric
Gas vs Electric
LED Savings
LED Savings
Salary Calculator
Salary Calculator
Budget Calculator
Budget Calculator
Car calculators
Trip Gas Cost
Trip Gas Cost
EV Charging Cost
EV Charging Cost
EV vs Gas Cost
EV vs Gas Cost
MPG Calculator
MPG Calculator
Tire Size
Tire Size
Solar power and battery calculators
Solar Output
Solar Output
Solar Panel Count
Solar Panel Count
Solar Payback
Solar Payback
Battery Size
Battery Size
Home and DIY calculators
Tile Calculator
Tile Calculator
Stair Calculator
Stair Calculator
Concrete Volume
Concrete Volume
Wall Area
Wall Area
Wallpaper Rolls
Wallpaper Rolls
Paint Calculator
Paint Calculator
Flooring Needed
Flooring Needed
Exterior Walls
Exterior Walls
Gravel Needed
Gravel Needed
Mortar Mix
Mortar Mix
Slope Grade
Slope Grade
Lumber Cut List
Lumber Cut List
Lot Coverage/FAR
Lot Coverage/FAR
Sheet Vinyl Roll
Sheet Vinyl Roll
Insulation Needed
Insulation Needed
Curtain Size
Curtain Size
TV Size & Distance
TV Size & Distance
Soil Needed
Soil Needed
Sod Needed
Sod Needed
Block Calculator
Block Calculator
Brick Calculator
Brick Calculator
Deck Materials
Deck Materials
Ramp Length
Ramp Length
Pilot Hole Size
Pilot Hole Size
Room Ventilation
Room Ventilation
Paint Thinning
Paint Thinning
Baseboard & Trim
Baseboard & Trim
Blind Size
Blind Size
Picture Hanging
Picture Hanging
Drain Slope
Drain Slope
Screw Calculator
Screw Calculator
Board Feet
Board Feet
Fence Calculator
Fence Calculator
Wood Shrinkage
Wood Shrinkage
Caulk Calculator
Caulk Calculator
Heat Loss
Heat Loss
Furniture Fit
Furniture Fit
Moving Boxes
Moving Boxes
Storage Capacity
Storage Capacity
Plywood Cuts
Plywood Cuts
Shelf Sag
Shelf Sag

Number Base Converter (Binary, Octal, Decimal and Hexadecimal)

Choose the base of your number and enter the number written in that base. The page converts it to binary, octal, decimal and hexadecimal at once and shows the steps.

Whole numbers from 0 up to 64 binary digits (18,446,744,073,709,551,615 in decimal) are supported. Hex digits A to F can be entered in upper or lower case.
Result
Choose the base of your number on the left, enter the number and press "Calculate". The number will appear here in all four bases.

What you can do on this page

  • Choose the base of your number (binary, octal, decimal or hexadecimal) and enter it, and you see the same number in all four bases at once
  • Answers questions like "What is hex 2AA in decimal?" or "What is 170 in binary?" in one step
  • It shows the place value expansion (each digit × its place value, all added up) and the repeated division by the base with the remainders, so you learn how the conversion works
  • Useful for studying base conversion and checking answers for computer science classes and IT certification exams
  • A plain-language explanation of the formulas and copy-and-paste formulas for Excel, Google Sheets and Python are all on this page
You can convert whole numbers from 0 up to 64 binary digits (about 18.4 quintillion in decimal). Fractions and negative numbers are not supported.

What is this calculation used for?

A standard topic in computer science classes and IT exams

Base conversion is a standard topic in high school and college computer science courses, such as AP Computer Science Principles, and in IT certification exams such as CompTIA A+ and Network+.
Questions like "What is binary 1010 in decimal?" or "Write decimal 45 in binary" use exactly the two methods on this page: the place value expansion and the repeated division with remainders. Practicing with the steps shown helps you work through them without getting stuck on the exam.

Color codes in web design and programming (hexadecimal)

Colors on web pages are set with hexadecimal color codes such as "#FF5733". The code lists the strength of red, green and blue as two hex digits each (00 to FF = 0 to 255 in decimal), so #FF5733 is red FF (255), green 57 (87) and blue 33 (51).
Once you can move between hexadecimal and decimal, you can picture color changes such as "a little less red" directly from the numbers in the code.

Linux file permissions are octal

The 755 in "chmod 755", a command often used on servers, is an octal number. Each octal digit matches 3 binary digits, and 755 in binary is 111 101 101 - on/off switches for "read, write, execute", 3 bits each for the owner, the group and everyone else.
Once you understand number bases, this number is no longer a secret code but a table of bit switches.

Understanding IP addresses and subnet masks (binary)

An IP address, such as 192.168.1.1, is really a binary number split into four 8-bit parts: 192 is 11000000 and 255 is 11111111.
Networking basics such as "the subnet mask 255.255.255.0 marks the first 24 bits are the network part" only make sense once you can convert between decimal and binary. This knowledge is the foundation for network engineering work and for certifications such as CCNA.

Learning how computers work (bits, bytes and memory)

"One byte = 8 bits, which can hold 0 to 255 (00 to FF in hex)" and "memory addresses and error codes are shown in hex, such as 0x7FFF" - binary and hexadecimal are the common language for learning what happens inside a computer.
Topics that often trip up programming students, such as bitwise operations, character codes and color values, become much clearer once you can convert between bases freely.

Formula

Base \(n\) → decimal (positional notation)
Standard notation (the usual math form)
\(N\) \(=\) \(\displaystyle\sum_{i=0}^{k}\) \(d_i\) \(\times\) \(b^{i}\)
In words (symbols replaced with words)
④ decimal value \(N\) \(=\) ③ add them all \(\displaystyle\sum\) ① each digit \(d_i\) \(\times\) ② place value \(b^i\)
The formula in words
① Multiply each digit \(d_i\) by
② its place value \(b^i\) (the base \(b\) multiplied by itself \(i\) times, where \(i\) is the digit position) ,
③ add them all up \(\displaystyle\sum\) ,
④ and you get the decimal value \(N\)
Quick example
Converting hexadecimal 2AA to decimal (A is 10 in decimal, and the base is \(b=16\))
decimal value \(N\) \(=\) \(2\) \(\times\) \(16^2\) \(+\) \(10\) \(\times\) \(16^1\) \(+\) \(10\) \(\times\) \(16^0\)
\(2 \times 256 + 10 \times 16 + 10 \times 1 = 512 + 160 + 10 = 682\)
Key idea
Positional notation is a way of writing numbers where each digit position has its own place value. It works exactly like the everyday decimal system, \(682 = 6 \times 100 + 8 \times 10 + 2 \times 1\); the only difference is whether the place values are powers of 10 or powers of 2, 8 or 16. The rightmost digit is position \(i=0\) (place value \(b^0=1\)), and each step to the left multiplies the place value by the base \(b\). In hexadecimal, the letters A to F stand for 10 to 15.
Decimal → base \(n\) (divide by the base and read the remainders in reverse)
Standard notation (the usual math form)
\(N\) \(=\) \(b\) \(\times\) \(q\) \(+\) \(r\)
In words (symbols replaced with words)
① decimal value \(N\) \(=\) ② base \(b\) \(\times\) ③ quotient \(q\) \(+\) ④ remainder \(r\)
The formula in words
① Divide the decimal value \(N\) by
② the base \(b\) to get
③ a quotient \(q\) and
④ a remainder \(r\) . Repeat this with each new quotient until the quotient is 0. The remainders, read from the last one to the first (so the last remainder becomes the leftmost digit), are the digits of the base \(n\) number
Quick example
Converting decimal 682 to hexadecimal (the first division; the remainder 10 is the hex digit A)
decimal value (682) \(=\) base (16) \(\times\) quotient (42) \(+\) remainder (10 = A)
\(682 = 16 \times 42 + 10\)
\(42 = 16 \times 2 + 10\)
\(2 = 16 \times 0 + 2\)
Key idea
The remainders come out starting from the rightmost (lowest) digit. For 682, the remainders appear in the order 10 (A) → 10 (A) → 2, so reading them in reverse gives \(2\mathrm{AA}_{16}\). Remember: "the last remainder is the leftmost digit". To convert to binary, do the same with \(b=2\); for octal, use \(b=8\).
Binary ⇔ hexadecimal (groups of 4 bits)
Standard notation (the usual math form)
\(h\) \(=\) \(b_3 \times 2^3 + b_2 \times 2^2 + b_1 \times 2^1 + b_0 \times 2^0\)
In words (symbols replaced with words)
② one hex digit \(h\) \(=\) ① value of 4 bits
The formula in words
① Split the binary number into groups of 4 digits from the right, and find the value of each group of 4 (\(b_3 \times 8 + b_2 \times 4 + b_1 \times 2 + b_0 \times 1\)) . That value is
② one hex digit \(h\) (for octal, use groups of 3 digits in the same way)
Quick example
Converting binary 001010101010 to hexadecimal by splitting it into groups of 4 from the right
0010 / 1010 / 1010 \(\rightarrow\) 2 / A / A
\(0010_{2} = 2,\ \ 1010_{2} = 10 = \mathrm{A}\)
\(001010101010_{2} = 2\mathrm{AA}_{16}\)
Key idea
One hex digit matches exactly 4 binary digits (a nibble). Without going through decimal, you can use a table of 4-digit groups (0000=0, 0001=1, …, 1111=F) to turn even a long binary number into hexadecimal mechanically. This is why programmers use hexadecimal so much: it is a compact way to write binary. Octal matches 3 binary digits, so the same method works with groups of 3.
Base conversion comes down to two directions. From base \(n\) to decimal, multiply each digit by its place value and add them all up. From decimal to base \(n\), divide by the base repeatedly and read the remainders from bottom to top. Between binary and hexadecimal, groups of 4 bits (3 bits for octal) let you convert directly without going through decimal.

Symbols and terms

Symbols

\(b\) bee The base (radix), the number that tells which number system is used. On this page it is 2, 8, 10 or 16. (From "base".)
\(d_i\) dee sub i The digit in position \(i\), counting from the right (the rightmost digit is position 0). In hexadecimal it can also be A to F (10 to 15 in decimal). (From "digit".)
\(i\) i The digit position. The rightmost digit is \(i=0\), and it goes up by 1 for each digit to the left.
\(N\) N The value in decimal. The conversion steps on this page always go through this decimal value.
\(\sum\) sigma The symbol for "add them all up" (summation). \(\sum_{i=0}^{k}\) says "let \(i\) go from 0 to \(k\) and add up all the terms".
\(q\) q The quotient of a division. To convert decimal to base \(n\), keep dividing until the quotient is 0. (From "quotient".)
\(r\) r The remainder of a division. The remainders become the digits of the base \(n\) number, starting from the rightmost digit. (From "remainder".)
\(2\mathrm{AA}_{16}\) two A A, base sixteen The small 16 written at the lower right of a number tells you "this number is written in base 16 (hexadecimal)". In the same way, \(1010_{2}\) is a binary number. This notation is used when the base might be unclear. Programmers also write hexadecimal with the prefix 0x, as in 0x2AA.

Terms

base (radix) The rule for how many of something make one group (a carry to the next digit) when you count. Everyday numbers group by 10 (decimal), and computers work internally in groups of 2 (binary). The group size (2, 8, 10, 16 and so on) is called the base or radix.
positional notation A way of writing numbers where each digit position has its own place value. It works just like decimal 682 standing for \(6 \times 100 + 8 \times 10 + 2 \times 1\); in binary, octal and hexadecimal, the place values are powers of 2, 8 and 16.
binary A way of writing numbers with only two digits, 0 and 1 (base 2). Computers handle information as electrical on and off states, so all their internal calculations are done in binary.
octal A way of writing numbers with the eight digits 0 to 7 (base 8). One octal digit matches 3 binary digits. It is used for file permissions in Linux and Unix, such as "755".
hexadecimal A way of writing numbers with sixteen symbols, 0 to 9 and A to F (A is 10, B is 11, …, F is 15), also called hex (base 16). One hex digit matches 4 binary digits, so programmers use it widely to write long binary numbers in a short form.
bit One binary digit. It is the smallest unit of information a computer handles, and its value is either 0 or 1.
nibble A group of 4 bits (one hex digit). Two nibbles make one byte.
byte A group of 8 bits (two hex digits). One byte holds 256 different values, from 00 to FF in hex, which is why bytes and hexadecimal go so well together.

Good to know before you start

Here is what helps you use the calculation on this page with real understanding, not just by pressing the button.

Place value in the decimal system (elementary school)
  • Being able to break 682 into "6 hundreds, 8 tens and 2 ones" = \(6 \times 100 + 8 \times 10 + 2 \times 1\)
  • Knowing that each place to the left is worth 10 times as much
Division with remainders (Grades 3–4)
  • Being able to find the quotient and remainder of a division such as 682 ÷ 16
  • Understanding that dividend = divisor × quotient + remainder
Powers and exponents (Grades 6–8)
  • Knowing that "to the \(n\)th power" is multiplying the same number \(n\) times, as in \(2^3 = 2 \times 2 \times 2 = 8\)
  • Knowing that any number to the power 0 is 1, as in \(16^0 = 1\)
Number bases (high school math and computer science)
  • Knowing that numbers can be written not only in decimal but in many systems with different bases (you can learn this on this page)

How to calculate it in Excel

Copy the whole table below and paste it into cell A1 in Excel. It works as is.
Table to convert decimal to binary, octal and hexadecimal
Decimal value 170
Binary =DEC2BIN(B1)
Octal =DEC2OCT(B1)
Hexadecimal =DEC2HEX(B1)
Table to convert binary to decimal
Binary 10101010
Decimal =BIN2DEC(B1)
Table to convert hexadecimal to decimal
Hexadecimal 2AA
Decimal =HEX2DEC(B1)
Table to convert large numbers (BASE and DECIMAL functions)
Decimal value 1500
Hexadecimal (BASE) =BASE(B1,16)
Back from hexadecimal to decimal (DECIMAL) =DECIMAL(B2,16)
In the first table, enter a decimal number in B1, and B2 to B4 show it in binary, octal and hexadecimal (170 gives 10101010, 252 and AA).
Note that these functions have size limits. DEC2BIN works only from −512 to 511 (results of up to 10 binary digits), DEC2OCT from −536,870,912 to 536,870,911, and DEC2HEX from −549,755,813,888 to 549,755,813,887. The reverse functions BIN2DEC, OCT2DEC and HEX2DEC also accept at most 10 digits; more than 10 digits gives an error, and with exactly 10 digits and a leading 1 bit (a leading 8 to F in hex), the value is read as a negative number (two's complement).
For larger numbers, use the BASE function (decimal → base n) and the DECIMAL function (base n → decimal) in the fourth table (Excel 2013 or later; they handle numbers up to about 9 quadrillion, 2 to the 53rd power minus 1).

How to calculate it in Google Sheets

Copy the whole table below and paste it into cell A1 in Google Sheets. It works as is.
Table to convert decimal to binary, octal and hexadecimal
Decimal value 170
Binary =DEC2BIN(B1)
Octal =DEC2OCT(B1)
Hexadecimal =DEC2HEX(B1)
Table to convert binary to decimal
Binary 10101010
Decimal =BIN2DEC(B1)
Table to convert hexadecimal to decimal
Hexadecimal 2AA
Decimal =HEX2DEC(B1)
Table to convert large numbers (BASE and DECIMAL functions)
Decimal value 1500
Hexadecimal (BASE) =BASE(B1,16)
Back from hexadecimal to decimal (DECIMAL) =DECIMAL(B2,16)
The same functions as in Excel work as is. Copy the whole table, paste it into cell A1, and replace B1 with your own number.
The size limits, such as DEC2BIN working only from −512 to 511, are the same as in Excel. For larger numbers, use the BASE and DECIMAL functions.

How to calculate it in Python

number = "2AA"   # the number to convert (written in its own base)
from_base = 16   # the base of that number (2, 8, 10 or 16)

value = int(number, from_base)    # first turn it into a decimal integer

binary = format(value, "b")       # binary
octal = format(value, "o")        # octal
hexadecimal = format(value, "X")  # hexadecimal (upper case)

print(f"Decimal: {value}")
print(f"Binary: {binary}")
print(f"Octal: {octal}")
print(f"Hexadecimal: {hexadecimal}")
Runs with the standard library only. int(text, base) converts base n → decimal, and format(value, "b"/"o"/"X") converts decimal → binary/octal/hexadecimal. Python integers have no size limit, so any number, however large, can be converted. Change the first two lines and run it.

How to write it in LaTeX and other math languages (copy and paste)

Base \(n\) → decimal (positional notation)
N = Σ dᵢ × bⁱ
N = \sum_{i=0}^{k} d_i \times b^{i}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>N</mi>
    <mo>=</mo>
    <munderover>
      <mo>&#x2211;</mo>
      <mrow><mi>i</mi><mo>=</mo><mn>0</mn></mrow>
      <mi>k</mi>
    </munderover>
    <msub><mi>d</mi><mi>i</mi></msub>
    <mo>&#xD7;</mo>
    <msup><mi>b</mi><mi>i</mi></msup>
  </mrow>
</math>
N = sum_(i=0)^k d_i * b^i
FromDigits[{2, 10, 10}, 16]
N := add(d[i]*b^i, i = 0 .. k);
N = polyval(d, b);
N = ∑_(i=0)^k d_i × b^i
Decimal → base \(n\) (divide by the base and read the remainders in reverse)
N = b × q + r (0 ≤ r < b)
N = b \times q + r \quad (0 \le r < b)
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>N</mi>
    <mo>=</mo>
    <mi>b</mi>
    <mo>&#xD7;</mo>
    <mi>q</mi>
    <mo>+</mo>
    <mi>r</mi>
  </mrow>
</math>
N = b q + r, \ 0 <= r < b
QuotientRemainder[682, 16]
q := iquo(n, b); r := irem(n, b);
q = floor(n/b); r = mod(n, b);
N = b × q + r (0 ≤ r < b)
Binary ⇔ hexadecimal (groups of 4 bits)
h = b₃×2³ + b₂×2² + b₁×2¹ + b₀×2⁰
h = b_3 \times 2^3 + b_2 \times 2^2 + b_1 \times 2^1 + b_0 \times 2^0
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>h</mi>
    <mo>=</mo>
    <msub><mi>b</mi><mn>3</mn></msub><mo>&#xD7;</mo><msup><mn>2</mn><mn>3</mn></msup>
    <mo>+</mo>
    <msub><mi>b</mi><mn>2</mn></msub><mo>&#xD7;</mo><msup><mn>2</mn><mn>2</mn></msup>
    <mo>+</mo>
    <msub><mi>b</mi><mn>1</mn></msub><mo>&#xD7;</mo><msup><mn>2</mn><mn>1</mn></msup>
    <mo>+</mo>
    <msub><mi>b</mi><mn>0</mn></msub><mo>&#xD7;</mo><msup><mn>2</mn><mn>0</mn></msup>
  </mrow>
</math>
h = b_3*2^3 + b_2*2^2 + b_1*2 + b_0
FromDigits[{b3, b2, b1, b0}, 2]
h := 8*b3 + 4*b2 + 2*b1 + b0;
h = 8*b3 + 4*b2 + 2*b1 + b0;
h = b_3 × 2^3 + b_2 × 2^2 + b_1 × 2^1 + b_0 × 2^0

How to have ChatGPT  do the calculation

You are a number base conversion assistant. Do the following calculation by actually running Python code, and base your answer only on the numbers from the execution result (do not answer by mental math or guessing).

Convert hexadecimal 2AA to each of these bases:
1. Decimal
2. Binary
3. Octal

For the hexadecimal-to-decimal conversion, also show the expansion of each digit × its place value (a power of 16).
Show the code you used and the numbers from the execution result.

How to Use
  1. 1
    Enter your numbers
    Type the numbers you want to calculate with into the input fields
  2. 2
    Calculate
    Press the "Calculate" button
  3. 3
    Check the result
    The result appears on the spot. The same page also explains the idea behind the calculation and the formula
  DataChef Features
Easy and Free
Unlimited conversions for free.
No technical knowledge required.
Intuitive and user-friendly operation.
No Registration Required
Available immediately after access.
Can be used without registering personal information.
Safe and Secure
Fully SSL encrypted communication.
Automatic file deletion by clicking "download".
Fast
High-speed site access
and rapid file conversion.
No Watermark
No watermark.
No attribution required.
Commercial Use Available
Free for commercial use.
No need to contact us for commercial use permission.