[Home](https://learningfolio.de5.net/) / [Math](https://learningfolio.de5.net/math/) / [Math glossary](https://learningfolio.de5.net/math/glossary/) / Number Systems in Maths: Decimal, Binary, Octal, and Hexadecimal

[Math glossary](https://learningfolio.de5.net/math/glossary/)

# Number Systems in Maths: Decimal, Binary, Octal, and Hexadecimal

Understand positional number systems and learn to convert whole numbers and fractions between binary, octal, decimal, and hexadecimal.

Written by **Learningfolio Team**

We’re subject-matter experts in math, science, parent support, and education, with 100 years of combined experience. We believe in learning, experimenting, and growing, and we review one another’s work.

## On this page

* [TL;DR](https://learningfolio.de5.net/math/number-system-in-maths/#tldr)
* [Key Points](https://learningfolio.de5.net/math/number-system-in-maths/#key-points)
* [What is a number system in maths?](https://learningfolio.de5.net/math/number-system-in-maths/#what-is-a-number-system-in-maths)
* [What are the four common positional number systems?](https://learningfolio.de5.net/math/number-system-in-maths/#what-are-the-four-common-positional-number-systems)
* [How do you read any base in decimal?](https://learningfolio.de5.net/math/number-system-in-maths/#how-do-you-read-any-base-in-decimal)
* [How do you convert decimal to binary, octal, or hexadecimal?](https://learningfolio.de5.net/math/number-system-in-maths/#how-do-you-convert-decimal-to-binary-octal-or-hexadecimal)
* [When can you convert without going through decimal?](https://learningfolio.de5.net/math/number-system-in-maths/#when-can-you-convert-without-going-through-decimal)
* [How are numeral systems different from number sets?](https://learningfolio.de5.net/math/number-system-in-maths/#how-are-numeral-systems-different-from-number-sets)
* [Worked Number-System Examples](https://learningfolio.de5.net/math/number-system-in-maths/#worked-number-system-examples)
* [Mistakes That Change Base Conversion](https://learningfolio.de5.net/math/number-system-in-maths/#mistakes-that-change-base-conversion)
* [Try It Yourself](https://learningfolio.de5.net/math/number-system-in-maths/#try-it-yourself)
* [Answers and Reasoning](https://learningfolio.de5.net/math/number-system-in-maths/#answers-and-reasoning)
* [Frequently Asked Questions](https://learningfolio.de5.net/math/number-system-in-maths/#frequently-asked-questions)
* [Conclusion](https://learningfolio.de5.net/math/number-system-in-maths/#conclusion)
* [Read More](https://learningfolio.de5.net/math/number-system-in-maths/#read-more)
* [Research Behind This Article](https://learningfolio.de5.net/math/number-system-in-maths/#research-behind-this-article)

## TL;DR

**A positional number system writes values using digits and a base.** Decimal uses base 10, binary uses base 2, octal uses base 8, and hexadecimal uses base 16. Place values are powers of the base.

## Key Points

* The base tells you how many digit values are available and how adjacent places relate.
* Digits in base $b$ have values from zero through $b-1$.
* Read a numeral by multiplying each digit by its place value and adding the results.
* To convert a decimal whole number to another base, divide repeatedly and read the remainders from last to first.
* A base changes how a number looks. Sets such as integers and rational numbers classify its value.

## What is a number system in maths?

A number system is a way to represent numbers. In a **positional** number system, both the digit and its position contribute to the value. For instance, the same 2 represents twenty in $24_{10}$ and sixteen in $24_8$. In the first numeral it occupies the tens place. In the second it occupies the eights place.

The small subscript names the base. Use it when more than one base appears. For example, $10_2$, $10_8$, $10_{10}$, and $10_{16}$ have values two, eight, ten, and sixteen respectively. The units place always has weight $b^0=1$ in base $b$. Moving one place to the left multiplies the weight by $b$. [OpenStax, Introduction to Whole Numbers](https://openstax.org/books/prealgebra-2e/pages/1-1-introduction-to-whole-numbers)

![The numeral ten has value two in binary, eight in octal, ten in decimal, and sixteen in hexadecimal](https://learningfolio.de5.net/assets/versioned/number-system-four-bases-place-values.980061281736.webp)


The written digits stay the same in each row. The base determines the weight of the left digit.

Roman numerals also represent numbers, with rules for combining symbols. Their letters do not mark columns of base powers. See the [Roman numerals chart](https://learningfolio.de5.net/math/roman-numerals/) for a comparison.

## What are the four common positional number systems?

| System | Base | Digits | Where you may see it |
| --- | --- | --- | --- |
| Binary | 2 | 0 and 1 | Digital circuits and bit patterns |
| Octal | 8 | 0 through 7 | Compact notation for groups of three bits |
| Decimal | 10 | 0 through 9 | Everyday measurements and calculations |
| Hexadecimal | 16 | 0 through 9, then A through F | Compact notation for groups of four bits |

Hexadecimal uses A for ten, B for eleven, C for twelve, D for thirteen, E for fourteen, and F for fifteen. So $1F_{16}$ means one sixteen plus fifteen ones. Octal has no digit 8, just as binary has no digit 2. [McMaster University, Number Systems](https://physics.mcmaster.ca/phy4d6/Lab/chapter1.htm)

## How do you read any base in decimal?

Starting from the units place, label the positions $b^0,b^1,b^2,b^3,\ldots$ as you move left. Multiply each digit by its position’s value. For a numeral with three digits $d_2,d_1,d_0$, the number is

$$
d_2b^2+d_1b+d_0.
$$

To the right of the radix point, use $b^{-1},b^{-2},b^{-3},\ldots$. For instance, the first place after the point in binary is worth one-half, and the first place after the point in octal is worth one-eighth. This extends the familiar place-value rule for tenths and hundredths.

## How do you convert decimal to binary, octal, or hexadecimal?

For a whole number, divide by the target base and save the remainder. Divide the quotient again until it is zero. Each division peels off the next digit from the right. Read the remainders from the bottom up. Convert remainders 10 through 15 to A through F for hexadecimal.

For a fractional part, multiply it by the target base. Take the integer part as the next digit to the right of the point and repeat with the new fractional part. Read those digits in the order you find them. A fraction can terminate in one base and repeat in another. A reduced fraction with denominator $q$ terminates in base $b$ exactly when $q$ divides some power of $b$. Decimal $0.1$ has denominator 10, so it repeats in binary because no power of 2 has a factor of 5. [Open Book Project, Number Systems and Complements](https://open-book-project.github.io/courses/csa_course/number-systems-and-complements.html)

## When can you convert without going through decimal?

Since $8=2^3$, every octal digit corresponds to three binary digits. Since $16=2^4$, every hexadecimal digit corresponds to four. Separate the binary digits into groups from the radix point outward. On the whole-number side you may pad the far left with zeros. On the fractional side you may pad the far right. Padding on the wrong end shifts the values.

To convert between octal and hexadecimal, expand each digit into binary, then regroup around the same point. The [binary number system guide](https://learningfolio.de5.net/math/binary-number-system/) and [hexadecimal conversion guide](https://learningfolio.de5.net/math/hex-to-decimal/) apply the method to longer numerals.

## How are numeral systems different from number sets?

A base tells you how to **write** a value. A number set tells you which values a category **contains**. The same number 12 is represented by $12_{10}$, $1100_2$, and $C_{16}$. In all three forms it is a positive integer and a rational number.

In much school mathematics, natural numbers start at 1, while whole numbers start at 0. Some textbooks include 0 in the natural numbers. Integers include the negative whole numbers, zero, and the positive whole numbers. A rational number can be written as a ratio of integers with a nonzero denominator. Irrational numbers such as $\sqrt{2}$ are real numbers outside that set. [OpenStax, Real Numbers: Algebra Essentials](https://openstax.org/books/college-algebra-2e/pages/1-1-real-numbers-algebra-essentials)

## Worked Number-System Examples

### Example 1

Convert $10110_2$ to decimal.

1. Label the five places 16, 8, 4, 2, and 1.
2. The ones occur in the 16, 4, and 2 places.
3. Add $16+4+2=22$.

### Example 2

Convert $572_8$ to decimal.

1. The positions have values 64, 8, and 1.
2. Multiply the digits by their weights: $5(64)$, $7(8)$, and $2(1)$.
3. Add $320+56+2=378$.

### Example 3

Write decimal 94 in hexadecimal.

1. Divide 94 by 16 to get quotient 5 and remainder 14.
2. Divide 5 by 16 to get quotient 0 and remainder 5.
3. Read the remainders up. Since 14 is E, the result is $5E_{16}$. Check $5(16)+14=94$.

### Example 4

Convert $1101011_2$ to octal and hexadecimal.

1. Group the integer places from the right in threes: $001$, $101$, $011$.
2. These groups give $153_8$.
3. Group instead in fours: $0110$, $1011$. These give $6B_{16}$. Both represent decimal 107.

### Example 5

Write decimal $0.6875$ in binary.

1. Double $0.6875$ to get $1.375$. Take digit 1 and keep $0.375$.
2. Double $0.375$ to get $0.75$. Take digit 0. Doubling $0.75$ gives $1.5$, so take digit 1.
3. Doubling the final $0.5$ gives $1.0$, so take digit 1 and stop. The result $0.1011_2$ equals $1/2+1/8+1/16$.

### Example 6

Add $27_8+16_8$ directly in octal.

1. The units digits sum to $7+6=13$ in decimal. That is one group of eight plus five, so write 5 and carry 1.
2. The eights digits sum to $2+1+1=4$.
3. The result is $45_8$. A decimal check gives $23+14=37=4(8)+5$.

## Mistakes That Change Base Conversion

### Mistake 1: Using a digit too large for the base

$108_8$ is invalid because 8 is not an octal digit. A single position can hold only zero through seven. Eight units carry into the next position.

### Mistake 2: Reading the division remainders from top to bottom

The first remainder belongs in the units place. For decimal 19, dividing repeatedly by 2 produces remainders 1, 1, 0, 0, 1 in that order. Reading upward gives $10011_2$.

### Mistake 3: Dropping a zero within a numeral

A zero can hold an empty place. In $203_8$, it keeps the 2 in the sixty-fours place. Removing it gives $23_8$, which has a different value.

## Try It Yourself

1. Convert $304_8$ to decimal.
2. Write decimal 45 in binary.
3. Convert $A.4_{16}$ to decimal.

## Answers and Reasoning

1. The value is $3(64)+4=196$.
2. $101101_2$. Its ones are in the 32, 8, 4, and 1 positions.
3. The value is $10+4/16=10.25$.

## Frequently Asked Questions

### Why do number systems use different bases?

Base 10 is the convention for most daily arithmetic. Base 2 uses two states, making it practical for digital representation. Octal and hexadecimal save space when people read and write binary values.

### Is $0.11_2$ the same number as $0.11_{10}$?

No. In binary, $0.11_2=1/2+1/4=0.75_{10}$. The decimal numeral $0.11_{10}$ means eleven hundredths.

### Does a negative number require a new digit?

Ordinary mathematical notation can use a minus sign before the numeral. A digital format may use a separate convention such as two’s complement. Its interpretation depends on bit width.

## Conclusion

* Identify the base and check that every digit is allowed.
* Use powers of the base to read a numeral or repeated division to write a whole number in a new base.
* Verify a conversion by evaluating the result in decimal.

## Read More

* [Browse related lessons in the math glossary](https://learningfolio.de5.net/math/glossary/)

## Research Behind This Article

1. OpenStax, *Prealgebra 2e: Introduction to Whole Numbers*. [OpenStax](https://openstax.org/books/prealgebra-2e/pages/1-1-introduction-to-whole-numbers)
2. McMaster University, *4D6 Lab Manual: Number Systems*. [McMaster Physics](https://physics.mcmaster.ca/phy4d6/Lab/chapter1.htm)
3. The Open Book Project, *Number Systems and Complements*. [Open Book Project](https://open-book-project.github.io/courses/csa_course/number-systems-and-complements.html)
4. OpenStax, *College Algebra 2e: Real Numbers, Algebra Essentials*. [OpenStax](https://openstax.org/books/college-algebra-2e/pages/1-1-real-numbers-algebra-essentials)
