Number Base Converter

All free toolsAdvanced Mathematics
Advanced MathematicsFree online tool

Number Base Converter

Convert signed integers between binary, octal, decimal, hexadecimal and bases 2–36.

Supports signed integers in bases 2–36. Fractional values are not supported in this version.

Free online tool by SOCE. Check inputs and results before using them for important decisions.

Number Base Converter – Free Binary, Decimal, Octal and Hexadecimal Guide

The SOCE Number Base Converter page helps students, teachers, engineers, programmers, and mathematics learners understand number systems and convert values between different numerical bases.

Number base conversion is an important concept in mathematics, computer science, digital electronics, and programming. It involves representing the same numerical value using different positional number systems.

Whether you are studying binary, decimal, octal, or hexadecimal numbers, this Number Base Converter resource explains the mathematical principles, conversion methods, and practical applications of number systems through clear worked examples.

What Is a Number Base Converter?

A Number Base Converter is a mathematical tool used to express a number in one positional numeral system as an equivalent representation in another base.

The base, also called the radix, determines how many distinct digit values are available and the place values assigned to each position.

For example, the decimal number 25 can be represented as:

  • Decimal: 25
  • Binary: 11001
  • Octal: 31
  • Hexadecimal: 19

All four representations describe the same numerical value.

Only the number system changes.

Understanding Number Systems

A positional number system represents values using digits and powers of a base.

The four commonly studied number systems are:

Number System Base Permitted Digits Example
Binary 2 0, 1 1010
Octal 8 0–7 12
Decimal 10 0–9 10
Hexadecimal 16 0–9, A–F A

In hexadecimal notation, the letters represent additional digit values:

A = 10

B = 11

C = 12

D = 13

E = 14

F = 15

A number’s base can be shown using a subscript.

For example:

(1010)₂ = (10)₁₀ = (12)₈ = (A)₁₆

These expressions are numerically equivalent.

How to Use the Number Base Converter

A general number base conversion involves the following steps:

  1. Identify the original number.
  2. Determine its source base.
  3. Verify that all digits are valid for the source base.
  4. Identify the required destination base.
  5. Apply the appropriate conversion method.
  6. Express the result using valid destination-base digits.
  7. Check the answer by converting it back to decimal or the original base.

For example, to convert binary 1011 into decimal:

1011₂ = 1 × 2³ + 0 × 2² + 1 × 2¹ + 1 × 2⁰

= 8 + 0 + 2 + 1

Answer: 11₁₀

Number Base Converter Formula

In a positional numeral system with base b, the value of a non-negative integer represented by digits dₙ … d₁d₀ is:

N = dₙbⁿ + … + d₁b¹ + d₀b⁰

Equivalently:

N = Σ dᵢbⁱ

where the summation covers all integer digit positions from 0 to n.

Each digit must satisfy:

0 ≤ dᵢ < b

For ordinary integer positional systems, b is an integer greater than or equal to 2.

Example: Convert Base 5 to Decimal

Consider:

(243)₅

Using positional notation:

= 2 × 5² + 4 × 5¹ + 3 × 5⁰

= 2 × 25 + 4 × 5 + 3 × 1

= 50 + 20 + 3

Answer: (73)₁₀

This principle works for any valid positional base.

Binary to Decimal Conversion

The binary number system uses base 2.

Only two digits are permitted:

0 and 1

Each position represents a power of 2.

Worked Example

Convert:

(110101)₂ to decimal

Expand using powers of 2:

1 × 2⁵ = 32

1 × 2⁴ = 16

0 × 2³ = 0

1 × 2² = 4

0 × 2¹ = 0

1 × 2⁰ = 1

Add the values:

32 + 16 + 4 + 1

Answer: (53)₁₀

Therefore:

(110101)₂ = (53)₁₀

Decimal to Binary Conversion

A positive decimal integer can be converted to binary using repeated division by 2.

The remainders are recorded and read from bottom to top.

Worked Example

Convert:

(45)₁₀ to binary

Division Quotient Remainder
45 ÷ 2 22 1
22 ÷ 2 11 0
11 ÷ 2 5 1
5 ÷ 2 2 1
2 ÷ 2 1 0
1 ÷ 2 0 1

Read the remainders from bottom to top:

Answer: (101101)₂

Verification:

32 + 8 + 4 + 1 = 45

Decimal to Octal Conversion

The octal number system uses base 8.

Its valid digits are:

0, 1, 2, 3, 4, 5, 6, 7

To convert a decimal integer to octal, repeatedly divide by 8 and read the remainders in reverse order.

Worked Example

Convert:

(125)₁₀ to octal

125 ÷ 8 = 15 remainder 5

15 ÷ 8 = 1 remainder 7

1 ÷ 8 = 0 remainder 1

Read the remainders from bottom to top:

Answer: (175)₈

Verification:

1 × 8² + 7 × 8¹ + 5 × 8⁰

= 64 + 56 + 5

= 125

Octal to Decimal Conversion

To convert an octal number to decimal, multiply each digit by the corresponding power of 8.

Worked Example

Convert:

(347)₈ to decimal

= 3 × 8² + 4 × 8¹ + 7 × 8⁰

= 3 × 64 + 4 × 8 + 7

= 192 + 32 + 7

Answer: (231)₁₀

Decimal to Hexadecimal Conversion

The hexadecimal number system uses base 16.

Its permitted digits are:

0–9 and A–F.

To convert a positive decimal integer to hexadecimal, repeatedly divide by 16 and convert remainders from 10 to 15 into A through F.

Worked Example

Convert:

(255)₁₀ to hexadecimal

255 ÷ 16 = 15 remainder 15

15 ÷ 16 = 0 remainder 15

The remainder 15 is represented by F.

Therefore:

Answer: (FF)₁₆

Verification:

15 × 16 + 15

= 240 + 15

= 255

Hexadecimal to Decimal Conversion

To convert hexadecimal to decimal, expand the digits using powers of 16.

Worked Example

Convert:

(2AF)₁₆ to decimal

Hexadecimal digit values:

2 = 2

A = 10

F = 15

Using positional notation:

2 × 16² + 10 × 16¹ + 15 × 16⁰

= 2 × 256 + 10 × 16 + 15

= 512 + 160 + 15

Answer: (687)₁₀

Binary to Octal Conversion

Binary can be converted directly to octal by grouping bits in sets of three, starting from the right for integer values.

Each group of three bits corresponds to one octal digit.

Worked Example

Convert:

(1101011)₂ to octal

Group the binary digits from the right:

001 101 011

Convert each group:

001 = 1

101 = 5

011 = 3

Therefore:

Answer: (153)₈

Verification:

(153)₈ = 1 × 64 + 5 × 8 + 3

= 64 + 40 + 3

= 107

And:

(1101011)₂ = 64 + 32 + 8 + 2 + 1

= 107

Octal to Binary Conversion

Each octal digit can be represented using three binary bits.

Worked Example

Convert:

(57)₈ to binary

5 = 101

7 = 111

Combine the groups:

Answer: (101111)₂

Verification:

(57)₈ = 5 × 8 + 7 = 47

(101111)₂ = 32 + 8 + 4 + 2 + 1 = 47

Binary to Hexadecimal Conversion

Binary numbers can be converted to hexadecimal by grouping bits into sets of four, starting from the right for integer values.

Worked Example

Convert:

(11101011)₂ to hexadecimal

Group the bits:

1110 1011

Convert each group:

1110 = E

1011 = B

Therefore:

Answer: (EB)₁₆

Verification:

14 × 16 + 11

= 224 + 11

= 235

Hexadecimal to Binary Conversion

Each hexadecimal digit corresponds to four binary bits.

Worked Example

Convert:

(3A)₁₆ to binary

3 = 0011

A = 1010

Combine the groups:

0011 1010

Remove the unnecessary leading zeros:

Answer: (111010)₂

Verification:

(3A)₁₆ = 3 × 16 + 10 = 58

(111010)₂ = 32 + 16 + 8 + 2 = 58

Octal to Hexadecimal Conversion

Octal and hexadecimal numbers can be converted through binary or decimal representation.

Worked Example

Convert:

(157)₈ to hexadecimal

First, convert octal to decimal:

1 × 8² + 5 × 8¹ + 7 × 8⁰

= 64 + 40 + 7

= 111

Next, convert decimal 111 to hexadecimal:

111 ÷ 16 = 6 remainder 15

Remainder 15 = F

Therefore:

Answer: (6F)₁₆

Hexadecimal to Octal Conversion

A hexadecimal number can be converted to octal using an intermediate decimal or binary representation.

Worked Example

Convert:

(7B)₁₆ to octal

First, convert hexadecimal to decimal:

7 × 16 + 11

= 112 + 11

= 123

Next, convert decimal to octal:

123 ÷ 8 = 15 remainder 3

15 ÷ 8 = 1 remainder 7

1 ÷ 8 = 0 remainder 1

Read the remainders in reverse order:

Answer: (173)₈

Number Base Converter for Other Bases

Positional numeral systems are not limited to binary, octal, decimal, and hexadecimal.

Other bases include:

  • Base 3: Ternary.
  • Base 5: Quinary.
  • Base 12: Duodecimal.
  • Base 16: Hexadecimal.

Worked Example: Base 7 to Decimal

Convert:

(256)₇ to decimal

= 2 × 7² + 5 × 7¹ + 6 × 7⁰

= 98 + 35 + 6

Answer: (139)₁₀

Any number base conversion must use valid digits for the specified base.

Converting Fractional Numbers Between Bases

Positional notation can also represent fractional values.

Digits to the right of the radix point correspond to negative powers of the base.

For example:

(101.101)₂

Convert to decimal:

1 × 2² + 0 × 2¹ + 1 × 2⁰ + 1 × 2⁻¹ + 0 × 2⁻² + 1 × 2⁻³

= 4 + 1 + 0.5 + 0.125

Answer: (5.625)₁₀

Decimal Fraction to Binary

Consider:

0.625

Multiply the fractional part repeatedly by 2:

0.625 × 2 = 1.25 → digit 1

0.25 × 2 = 0.5 → digit 0

0.5 × 2 = 1.0 → digit 1

Therefore:

(0.625)₁₀ = (0.101)₂

Not every decimal fraction has a finite binary representation. For example, 0.1 in decimal has an infinite repeating binary expansion.

Fractional conversion is an important mathematical extension, but it should only be advertised as a calculator feature if the actual tool supports it.

Negative Numbers and Signed Representations

Negative integers can be written mathematically using a minus sign.

For example:

(−13)₁₀ = (−1101)₂

However, computers commonly represent signed integers using fixed-width binary formats, including two’s complement.

For example, in 8-bit two’s complement:

−13 = 11110011

The exact bit pattern depends on the selected width and representation convention.

A general mathematical base converter and a signed-integer bit-pattern converter are not necessarily the same tool.

Number Base Converter and Computer Science

Number base conversion is essential in computer science because digital systems operate using binary states.

Binary in Computing

Binary numbers represent information using 0 and 1.

They form the basis of digital data representation and many logical operations.

Hexadecimal in Programming

Hexadecimal provides a compact way to represent binary values.

One hexadecimal digit corresponds to four binary bits.

Octal in Computing

Octal represents binary values using groups of three bits.

It is used in some computing contexts, including Unix-style file permission notation.

Digital Electronics

Binary, octal, decimal, and hexadecimal systems are important for understanding digital logic and electronic circuits.

Engineering and Research

Number base conversion is useful in numerical computing, embedded systems, digital instrumentation, and data representation.

Common Mistakes in Number Base Conversion

  1. Using invalid digits: Binary cannot contain digits other than 0 and 1.
  2. Confusing the source base with the destination base: Always identify both.
  3. Reading division remainders in the wrong order: Integer conversion by repeated division requires reading remainders from bottom to top.
  4. Using the wrong positional powers: Each position must use powers of the correct base.
  5. Confusing hexadecimal letters with decimal digits: A through F represent values 10 through 15.
  6. Grouping binary digits incorrectly: Use three-bit groups for octal and four-bit groups for hexadecimal.
  7. Ignoring leading-zero conventions: Leading zeros usually do not change the mathematical value but may matter in fixed-width representations.
  8. Confusing mathematical negative numbers with two’s complement: Signed binary representation requires additional conventions.
  9. Assuming every fraction converts into a finite representation: Some fractions repeat indefinitely in other bases.
  10. Ignoring numerical precision: Large integers and fractional conversions may require exact arithmetic or controlled precision.

Frequently Asked Questions About Number Base Converter

1. What is a Number Base Converter?

A Number Base Converter is a mathematical tool used to express the same numerical value in different positional number systems.

2. What is the binary number system?

Binary is a base-2 numeral system using the digits 0 and 1.

3. What is the decimal number system?

Decimal is a base-10 numeral system using the digits 0 through 9.

4. What is the octal number system?

Octal is a base-8 numeral system using the digits 0 through 7.

5. What is the hexadecimal number system?

Hexadecimal is a base-16 numeral system using digits 0 through 9 and letters A through F.

6. What is binary 1010 in decimal?

(1010)₂ = (10)₁₀.

7. What is decimal 25 in binary?

(25)₁₀ = (11001)₂.

8. What is decimal 255 in hexadecimal?

(255)₁₀ = (FF)₁₆.

9. What is hexadecimal FF in decimal?

(FF)₁₆ = (255)₁₀.

10. How do you convert binary to octal?

Group binary integer digits into sets of three from the right and convert each group to an octal digit.

11. How do you convert binary to hexadecimal?

Group binary integer digits into sets of four from the right and convert each group to a hexadecimal digit.

12. Why is number base conversion important?

It is fundamental to computer science, digital electronics, programming, numerical representation, and mathematics.

Learn Number Systems with SOCE

The SOCE Number Base Converter page provides mathematical explanations, conversion formulas, worked examples, and practical applications of positional numeral systems.

Use this Number Base Converter resource to strengthen your understanding of binary, decimal, octal, hexadecimal, and general number base conversion.

Explore additional free mathematics and engineering resources in the SOCE Advanced Mathematics collection.