ℹ️ Skipped - page is already crawled
| Filter | Status | Condition | Details |
|---|---|---|---|
| HTTP status | PASS | download_http_code = 200 | HTTP 200 |
| Age cutoff | PASS | download_stamp > now() - 6 MONTH | 0.2 months ago |
| History drop | PASS | isNull(history_drop_reason) | No drop reason |
| Spam/ban | PASS | fh_dont_index != 1 AND ml_spam_score = 0 | ml_spam_score=0 |
| Canonical | PASS | meta_canonical IS NULL OR = '' OR = src_unparsed | Not set |
| Property | Value |
|---|---|
| URL | https://www.geeksforgeeks.org/digital-logic/number-system-and-base-conversions/ |
| Last Crawled | 2026-04-02 18:02:31 (4 days ago) |
| First Indexed | 2025-07-04 19:03:15 (9 months ago) |
| HTTP Status Code | 200 |
| Meta Title | Base Conversions for Number System - GeeksforGeeks |
| Meta Description | Your All-in-One Learning Portal: GeeksforGeeks is a comprehensive educational platform that empowers learners across domains-spanning computer science and programming, school education, upskilling, commerce, software tools, competitive exams, and more., Your All-in-One Learning Portal. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions. |
| Meta Canonical | null |
| Boilerpipe Text | Last Updated :
27 Aug, 2025
Electronic and digital systems use various number systems such as Decimal, Binary, Hexadecimal and Octal, which are essential in computing.
Binary (base-2) is the foundation of digital systems.
Hexadecimal (base-16) and Octal (base-8) are commonly used to simplify the representation of binary data.
The Decimal system (base-10) is the standard system for everyday calculations.
Other number systems like Duodecimal (base-12), are less commonly used but have specific applications in certain fields.
Various Number Systems
Types of Number System
There are four common
types of number systems
based on the radix or base of the number :
1. Decimal Number System
The Decimal system is a base-10 number system.
It uses ten digits: 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9.
Each digit’s place value is a power of 10 (e.g., 10
0
, 10
1
, 10
2
).
It is the standard system for everyday counting and calculations.
2. Binary Number System
The Binary system is a base-2 number system.
It uses two digits: 0 and 1.
Each digit’s place value is a power of 2 (e.g., 2
0
, 2
1
, 2
2
).
The Binary system is the foundation for data representation in computers and
digital electronics
.
3. Octal Number System
The Octal system is a base-8 number system.
It uses eight digits: 0, 1, 2, 3, 4, 5, 6 and 7.
Each digit’s place value is a power of 8 (e.g., 8
0
, 8
1
, 8
2
).
It is often used to simplify the representation of binary numbers by grouping them into sets of three bits.
4. Hexadecimal Number System
The Hexadecimal system is a base-16 number system.
It uses sixteen digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E and F (where A = 10, B = 11, etc.).
Each digit’s place value is a power of 16 (e.g., 16
0
, 16
1
, 16
2
).
Hexadecimal simplifies binary by representing every 4 bits as one digit (0-F).
Number System Conversion Methods
A number N in base or radix b can be written as:
(N)
b
= d
n-1
d
n-2
-- -- -- -- d
1
d
0
. d
-1
d
-2
-- -- -- -- d
-m
In the above, d
n-1
to d
0
is the integer part, then follows a radix point and then d
-1
to d
-m
is the fractional part.
d
n-1
= Most significant bit (MSB)
d
-m
= Least significant bit (LSB)
Base in Number System
1. Decimal to Binary Number System Conversion
For Integer Part:
Divide the decimal number by 2.
Record the remainder (0 or 1).
Continue dividing the quotient by 2 until the quotient is 0.
The binary equivalent is the remainders read from bottom to top.
For Fractional Part:
Multiply the fractional part by 2.
Record the integer part (0 or 1).
Take the fractional part of the result and repeat the multiplication.
Continue until the fractional part becomes 0 or reaches the desired precision.
The binary equivalent is the integer parts recorded in sequence.
Example:
(10.25)
10
Decimal to Binary Conversion
For Integer Part (10):
Divide 10 by 2 → Quotient = 5, Remainder = 0
Divide 5 by 2 → Quotient = 2, Remainder = 1
Divide 2 by 2 → Quotient = 1, Remainder = 0
Divide 1 by 2 → Quotient = 0, Remainder = 1
Reading the remainders from bottom to top gives 1010.
For Fractional Part (0.25):
Multiply 0.25 by 2 → Result = 0.5, Integer part = 0
Multiply 0.5 by 2 → Result = 1.0, Integer part = 1
The fractional part ends here as the result is now 0. Reading from top to bottom gives 01.
Thus, the binary equivalent of (10.25)
10
is (1010.01)
2
.
2. Binary to Decimal Number System Conversion
For Integer Part:
Write down the binary number.
Multiply each digit by 2 raised to the power of its position, starting from 0 (rightmost digit).
Add up the results of these multiplications.
The sum is the decimal equivalent of the binary integer.
For Fractional Part:
Write down the binary fraction.
Multiply each digit by 2 raised to the negative power of its position, starting from -1 (first digit after the decimal point).
Add up the results of these multiplications.
The sum is the decimal equivalent of the binary fraction.
Example:
(1010.01)
2
1x2
3
+ 0x2
2
+ 1x2
1
+ 0x2
0
+ 0x2
-1
+ 1x2
-2
= 8+0+2+0+0+0.25 = 10.25
Thus, (1010.01)
2
= (10.25)
10
3. Decimal to Octal Number System Conversion
For Integer Part:
Divide the decimal number by 8.
Record the remainder (0 to 7).
Continue dividing the quotient by 8 until the quotient is 0.
The octal equivalent is the remainders read from bottom to top.
For Fractional Part:
Multiply the fractional part by 8.
Record the integer part (0 to 7).
Take the fractional part of the result and repeat the multiplication.
Continue until the fractional part becomes 0 or reaches the desired precision.
The octal equivalent is the integer parts recorded in sequence.
Example:
(10.25)
10
For Integer Part (10):
Divide 10 by 8 → Quotient = 1, Remainder = 2
Divide 1 by 8 → Quotient = 0, Remainder = 1
Octal equivalent = 12 (write the remainder, read from bottom to top). So, the octal equivalent of the integer part 10 is 12.
For Fractional Part (0.25):
Multiply 0.25 by 8 → Result = 2.0, Integer part = 2
The fractional part ends here as the result is now 0. So, the octal equivalent of the fractional part 0.25 is 0.2.
The octal equivalent of (10.25)
10
= (12.2)
8
4. Octal to Decimal Number System Conversion
For Integer Part:
Write down the octal number.
Multiply each digit by 8 raised to the power of its position, starting from 0 (rightmost digit).
Add up the results of these multiplications.
The sum is the decimal equivalent of the octal integer.
For Fractional Part:
Write down the octal fraction.
Multiply each digit by 8 raised to the negative power of its position, starting from -1 (first digit after the decimal point).
Add up the results of these multiplications.
The sum is the decimal equivalent of the octal fraction.
Example:
(12.2)
8
1 x 8
1
+ 2 x 8
0
+2 x 8
-1
= 8+2+0.25 = 10.25
Thus, (12.2)
8
= (10.25)
10
5. Decimal to Hexadecimal Conversion
For Integer Part:
Divide the decimal number by 16.
Record the remainder (0-9 or A-F).
Continue dividing the quotient by 16 until the quotient is 0.
The hexadecimal equivalent is the remainders read from bottom to top.
For Fractional Part:
Multiply the fractional part by 16.
Record the integer part (0-9 or A-F).
Take the fractional part of the result and repeat the multiplication.
Continue until the fractional part becomes 0 or reaches the desired precision.
The hexadecimal equivalent is the integer parts recorded in sequence.
Example:
(10.25)
10
Integer part:
10 ÷ 16 = 0, Remainder = A (10 in decimal is A in hexadecimal)
Hexadecimal equivalent = A
Fractional part:
0.25 × 16 = 4, Integer part = 4
Hexadecimal equivalent = 0.4
Thus, (10.25)
10
= (A.4)
16
6. Hexadecimal to Decimal Conversion
For Integer Part:
Write down the hexadecimal number.
Multiply each digit by 16 raised to the power of its position, starting from 0 (rightmost digit).
Add up the results of these multiplications.
The sum is the decimal equivalent of the hexadecimal integer.
For Fractional Part:
Write down the hexadecimal fraction.
Multiply each digit by 16 raised to the negative power of its position, starting from -1 (first digit after the decimal point).
Add up the results of these multiplications.
The sum is the decimal equivalent of the hexadecimal fraction.
Example: (A.4)
16
(A × 16
0
) + (4 × 16
-1
) = (10 × 1) + (4 × 0.0625)
Thus, (A.4)
16
= (10.25)
10
7. Hexadecimal to Binary Number System Conversion
To convert from Hexadecimal to Binary:
Each hexadecimal digit (0-9 and A-F) is represented by a 4-bit binary number.
For each digit in the hexadecimal number, find its corresponding 4-bit binary equivalent and write them down sequentially.
Example:
(3A)
16
(3)
16
= (0011)
2
(A)
16
= (1010)
2
Thus, (3A)
16
= (00111010)
2
8. Binary to Hexadecimal Number System Conversion
To convert from
Binary to Hexadecimal
:
Start from the rightmost bit and divide the binary number into groups of 4 bits each.
If the number of bits isn't a multiple of 4, pad the leftmost group with leading zeros.
Each 4-bit binary group corresponds to a single hexadecimal digit.
Replace each 4-bit binary group with the corresponding hexadecimal digit.
Example:
(1111011011)
2
0011
1101
1011
| | |
3 D B
Thus, (001111011011 )
2
= (3DB)
16
9. Binary to Octal Number System
To convert from binary to octal:
Starting from the rightmost bit, divide the binary number into groups of 3 bits.
If the number of bits is not a multiple of 3, add leading zeros to the leftmost group.
Each 3-bit binary group corresponds to a single octal digit.
The binary-to-octal conversion for each 3-bit group is as follows:
Octal
Binary Equivalent
0
000
1
001
2
010
3
011
4
100
5
101
6
110
7
111
Replace each 3-bit binary group with the corresponding octal digit.
Example:
(111101101)
2
111
101
101
| | |
7 5 5
Thus, (111101101)
2
= (755)
8
10. Octal to Binary Number System Conversion
To convert from octal to binary:
Each octal digit (0-7) corresponds to a 3-bit binary number.
For each octal digit, replace it with its corresponding 3-bit binary equivalent.
Example:
(153)
8
Break the octal number into digits: 1, 5, 3
Convert each digit to binary:
1 in octal = 001 in binary
5 in octal = 101 in binary
3 in octal = 011 in binary
Thus, (153)
8
= (001101011)
2 |
| Markdown | [](https://www.geeksforgeeks.org/)

- Sign In
- [Courses]()
- [Tutorials]()
- [Interview Prep]()
- [DE Tutorial](https://www.geeksforgeeks.org/digital-logic/digital-electronics-logic-design-tutorials/)
- [Number System](https://www.geeksforgeeks.org/maths/number-system-in-maths/)
- [Base Conversion](https://www.geeksforgeeks.org/digital-logic/number-system-and-base-conversions/)
- [Logic Gates](https://www.geeksforgeeks.org/digital-logic/logic-gates/)
- [Boolean Algebra](https://www.geeksforgeeks.org/digital-logic/boolean-algebra/)
- [Notes](https://www.geeksforgeeks.org/digital-logic/lmn-digital-electronics/)
- [Computer Network](https://www.geeksforgeeks.org/computer-networks/computer-network-tutorials/)
- [TOC](https://www.geeksforgeeks.org/theory-of-computation/introduction-of-theory-of-computation/)
- [Compiler Design](https://www.geeksforgeeks.org/compiler-design/compiler-design-tutorials/)
- [DBMS](https://www.geeksforgeeks.org/dbms/dbms/)
# Base Conversions for Number System
Last Updated : 27 Aug, 2025
Electronic and digital systems use various number systems such as Decimal, Binary, Hexadecimal and Octal, which are essential in computing.
- Binary (base-2) is the foundation of digital systems.
- Hexadecimal (base-16) and Octal (base-8) are commonly used to simplify the representation of binary data.
- The Decimal system (base-10) is the standard system for everyday calculations.
- Other number systems like Duodecimal (base-12), are less commonly used but have specific applications in certain fields.

Various Number Systems
## Types of Number System
There are four common [types of number systems](https://www.geeksforgeeks.org/maths/how-many-types-of-number-systems-are-there/) based on the radix or base of the number :
### 1\. Decimal Number System
- The Decimal system is a base-10 number system.
- It uses ten digits: 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9.
- Each digit’s place value is a power of 10 (e.g., 100, 101, 102).
- It is the standard system for everyday counting and calculations.
### 2\. Binary Number System
- The Binary system is a base-2 number system.
- It uses two digits: 0 and 1.
- Each digit’s place value is a power of 2 (e.g., 20, 21, 22).
- The Binary system is the foundation for data representation in computers and [digital electronics](https://www.geeksforgeeks.org/digital-logic/digital-electronics-logic-design-tutorials/).
### 3\. Octal Number System
- The Octal system is a base-8 number system.
- It uses eight digits: 0, 1, 2, 3, 4, 5, 6 and 7.
- Each digit’s place value is a power of 8 (e.g., 80, 81, 82).
- It is often used to simplify the representation of binary numbers by grouping them into sets of three bits.
### 4\. Hexadecimal Number System
- The Hexadecimal system is a base-16 number system.
- It uses sixteen digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E and F (where A = 10, B = 11, etc.).
- Each digit’s place value is a power of 16 (e.g., 160, 161, 162).
- Hexadecimal simplifies binary by representing every 4 bits as one digit (0-F).
## Number System Conversion Methods
A number N in base or radix b can be written as:
> (N)b = dn-1 dn-2 -- -- -- -- d1 d0 . d\-1 d\-2 -- -- -- -- d\-m
In the above, dn-1 to d0 is the integer part, then follows a radix point and then d\-1 to d\-m is the fractional part.
dn-1 = Most significant bit (MSB)
d\-m = Least significant bit (LSB)

Base in Number System
### 1\. Decimal to Binary Number System Conversion
****For Integer Part:****
- Divide the decimal number by 2.
- Record the remainder (0 or 1).
- Continue dividing the quotient by 2 until the quotient is 0.
- The binary equivalent is the remainders read from bottom to top.
****For Fractional Part:****
- Multiply the fractional part by 2.
- Record the integer part (0 or 1).
- Take the fractional part of the result and repeat the multiplication.
- Continue until the fractional part becomes 0 or reaches the desired precision.
- The binary equivalent is the integer parts recorded in sequence.
****Example:**** (10.25)10

Decimal to Binary Conversion
****For Integer Part (10):****
- Divide 10 by 2 → Quotient = 5, Remainder = 0
- Divide 5 by 2 → Quotient = 2, Remainder = 1
- Divide 2 by 2 → Quotient = 1, Remainder = 0
- Divide 1 by 2 → Quotient = 0, Remainder = 1
Reading the remainders from bottom to top gives 1010.
****For Fractional Part (0.25):****
- Multiply 0.25 by 2 → Result = 0.5, Integer part = 0
- Multiply 0.5 by 2 → Result = 1.0, Integer part = 1
The fractional part ends here as the result is now 0. Reading from top to bottom gives 01.
Thus, the binary equivalent of (10.25)10 is (1010.01)2.
### 2\. Binary to Decimal Number System Conversion
****For Integer Part:****
- Write down the binary number.
- Multiply each digit by 2 raised to the power of its position, starting from 0 (rightmost digit).
- Add up the results of these multiplications.
- The sum is the decimal equivalent of the binary integer.
****For Fractional Part:****
- Write down the binary fraction.
- Multiply each digit by 2 raised to the negative power of its position, starting from -1 (first digit after the decimal point).
- Add up the results of these multiplications.
- The sum is the decimal equivalent of the binary fraction.
****Example:**** (1010.01)2
> 1x23 + 0x22 + 1x21\+ 0x20 + 0x2 \-1 + 1x2 \-2 = 8+0+2+0+0+0.25 = 10.25
Thus, (1010.01)2 = (10.25)10
### 3\. Decimal to Octal Number System Conversion
****For Integer Part:****
- Divide the decimal number by 8.
- Record the remainder (0 to 7).
- Continue dividing the quotient by 8 until the quotient is 0.
- The octal equivalent is the remainders read from bottom to top.
****For Fractional Part:****
- Multiply the fractional part by 8.
- Record the integer part (0 to 7).
- Take the fractional part of the result and repeat the multiplication.
- Continue until the fractional part becomes 0 or reaches the desired precision.
- The octal equivalent is the integer parts recorded in sequence.
****Example:**** (10.25)10
****For Integer Part (10):****
- Divide 10 by 8 → Quotient = 1, Remainder = 2
- Divide 1 by 8 → Quotient = 0, Remainder = 1
Octal equivalent = 12 (write the remainder, read from bottom to top). So, the octal equivalent of the integer part 10 is 12.
****For Fractional Part (0.25):****
- Multiply 0.25 by 8 → Result = 2.0, Integer part = 2
The fractional part ends here as the result is now 0. So, the octal equivalent of the fractional part 0.25 is 0.2.
The octal equivalent of (10.25)10 = (12.2)8
### 4\. Octal to Decimal Number System Conversion
****For Integer Part:****
- Write down the octal number.
- Multiply each digit by 8 raised to the power of its position, starting from 0 (rightmost digit).
- Add up the results of these multiplications.
- The sum is the decimal equivalent of the octal integer.
****For Fractional Part:****
- Write down the octal fraction.
- Multiply each digit by 8 raised to the negative power of its position, starting from -1 (first digit after the decimal point).
- Add up the results of these multiplications.
- The sum is the decimal equivalent of the octal fraction.
****Example:**** (12.2)8
> 1 x 81 + 2 x 80 +2 x 8\-1 = 8+2+0.25 = 10.25
Thus, (12.2)8 = (10.25)10
### 5\. Decimal to Hexadecimal Conversion
****For Integer Part:****
- Divide the decimal number by 16.
- Record the remainder (0-9 or A-F).
- Continue dividing the quotient by 16 until the quotient is 0.
- The hexadecimal equivalent is the remainders read from bottom to top.
****For Fractional Part:****
- Multiply the fractional part by 16.
- Record the integer part (0-9 or A-F).
- Take the fractional part of the result and repeat the multiplication.
- Continue until the fractional part becomes 0 or reaches the desired precision.
- The hexadecimal equivalent is the integer parts recorded in sequence.
****Example:**** (10.25)10
****Integer part:****
- 10 ÷ 16 = 0, Remainder = A (10 in decimal is A in hexadecimal)
Hexadecimal equivalent = A
****Fractional part:****
- 0\.25 × 16 = 4, Integer part = 4
Hexadecimal equivalent = 0.4
Thus, (10.25)10 = (A.4)16
### 6\. Hexadecimal to Decimal Conversion
****For Integer Part:****
- Write down the hexadecimal number.
- Multiply each digit by 16 raised to the power of its position, starting from 0 (rightmost digit).
- Add up the results of these multiplications.
- The sum is the decimal equivalent of the hexadecimal integer.
****For Fractional Part:****
- Write down the hexadecimal fraction.
- Multiply each digit by 16 raised to the negative power of its position, starting from -1 (first digit after the decimal point).
- Add up the results of these multiplications.
- The sum is the decimal equivalent of the hexadecimal fraction.
Example: (A.4)16
> (A × 160) + (4 × 16\-1) = (10 × 1) + (4 × 0.0625)
Thus, (A.4)16 = (10.25)10
### 7\. Hexadecimal to Binary Number System Conversion
To convert from Hexadecimal to Binary:
- Each hexadecimal digit (0-9 and A-F) is represented by a 4-bit binary number.

- For each digit in the hexadecimal number, find its corresponding 4-bit binary equivalent and write them down sequentially.
****Example:**** (3A)16
- (3)16 = (0011)2
- (A)16 = (1010)2
Thus, (3A)16 = (00111010)2
### 8\. Binary to Hexadecimal Number System Conversion
To convert from [Binary to Hexadecimal](https://www.geeksforgeeks.org/maths/how-to-convert-binary-to-hexadecimal/):
- Start from the rightmost bit and divide the binary number into groups of 4 bits each.
- If the number of bits isn't a multiple of 4, pad the leftmost group with leading zeros.
- Each 4-bit binary group corresponds to a single hexadecimal digit.
- Replace each 4-bit binary group with the corresponding hexadecimal digit.
****Example:**** (1111011011)2
> 0011 1101 1011
> \| \| \|
> 3 D B
Thus, (001111011011 )2 = (3DB)16
### 9\. Binary to Octal Number System
To convert from binary to octal:
- Starting from the rightmost bit, divide the binary number into groups of 3 bits.
- If the number of bits is not a multiple of 3, add leading zeros to the leftmost group.
- Each 3-bit binary group corresponds to a single octal digit.
- The binary-to-octal conversion for each 3-bit group is as follows:
| Octal | Binary Equivalent |
|---|---|
| 0 | 000 |
| 1 | 001 |
| 2 | 010 |
| 3 | 011 |
| 4 | 100 |
| 5 | 101 |
| 6 | 110 |
| 7 | 111 |
- Replace each 3-bit binary group with the corresponding octal digit.
****Example:**** (111101101)2
> 111 101 101
> \| \| \|
> 7 5 5
Thus, (111101101)2 = (755)8
### 10\. Octal to Binary Number System Conversion
To convert from octal to binary:
- Each octal digit (0-7) corresponds to a 3-bit binary number.
- For each octal digit, replace it with its corresponding 3-bit binary equivalent.
****Example:**** (153)8
- Break the octal number into digits: 1, 5, 3
- Convert each digit to binary:
- 1 in octal = 001 in binary
- 5 in octal = 101 in binary
- 3 in octal = 011 in binary
Thus, (153)8 = (001101011)2
Suggested Quiz

8 Questions
How many symbols are there in the Hexadecimal number system?
- A
16
- B
15
- C
8
- D
7
Convert (5A1.C)16 to Octal.
- A
(2641.6)8
- B
(2461.6)8
- C
(3661.6)8
- D
(3614.6)8
Find the division of (70592)16 ÷ (80)16.
- A
E0B
- B
E0A
- C
1BD
- D
1DB
What is the result of the binary subtraction: (11110)₂ − (10110)₂?
- A
00100
- B
01000
- C
00110
- D
10000
Perform (110011)₂ ÷ (110)₂. What is the quotient in binary?
- A
1001
- B
1010
- C
1100
- D
1111
Convert 7₁₀ to 4-bit binary. ?
- A
0111
- B
1011
- C
1110
- D
0110
Which one of the following is the correct perfect square (in base 8) ?
- A
1008
- B
818
- C
648
- D
None of These
Convert 2047₁₀ to octal.?
- A
37768
- B
6654₈
- C
37778
- D
37768

Quiz Completed Successfully
Your Score :0/8
Accuracy :0%
Login to View Explanation
**1**/8
\< Previous
Next \>
Comment
[K](https://www.geeksforgeeks.org/user/Kriti%20Kushwaha/)
kartik
192
Article Tags:
Article Tags:
[Digital Logic](https://www.geeksforgeeks.org/category/computer-subject/computer-science-quizzes-gq/digital-logic/)
[school-programming](https://www.geeksforgeeks.org/tag/school-programming/)
[base-conversion](https://www.geeksforgeeks.org/tag/base-conversion/)
[CBSE - Class 11](https://www.geeksforgeeks.org/tag/cbse-class-11/)
[NUMBER SYSTEM](https://www.geeksforgeeks.org/tag/number-system/)
[\+1 More]()
### Explore
[](https://www.geeksforgeeks.org/)

Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)

Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
[](https://geeksforgeeksapp.page.link/gfg-app)[](https://geeksforgeeksapp.page.link/gfg-app)
- Company
- [About Us](https://www.geeksforgeeks.org/about/)
- [Legal](https://www.geeksforgeeks.org/legal/)
- [Privacy Policy](https://www.geeksforgeeks.org/legal/privacy-policy/)
- [Contact Us](https://www.geeksforgeeks.org/about/contact-us/)
- [Advertise with us](https://www.geeksforgeeks.org/advertise-with-us/)
- [GFG Corporate Solution](https://www.geeksforgeeks.org/gfg-corporate-solution/)
- [Campus Training Program](https://www.geeksforgeeks.org/campus-training-program/)
- Explore
- [POTD](https://www.geeksforgeeks.org/problem-of-the-day)
- [Job-A-Thon](https://practice.geeksforgeeks.org/events/rec/job-a-thon/)
- [Blogs](https://www.geeksforgeeks.org/category/blogs/?type=recent)
- [Nation Skill Up](https://www.geeksforgeeks.org/nation-skill-up/)
- Tutorials
- [Programming Languages](https://www.geeksforgeeks.org/computer-science-fundamentals/programming-language-tutorials/)
- [DSA](https://www.geeksforgeeks.org/dsa/dsa-tutorial-learn-data-structures-and-algorithms/)
- [Web Technology](https://www.geeksforgeeks.org/web-tech/web-technology/)
- [AI, ML & Data Science](https://www.geeksforgeeks.org/machine-learning/ai-ml-and-data-science-tutorial-learn-ai-ml-and-data-science/)
- [DevOps](https://www.geeksforgeeks.org/devops/devops-tutorial/)
- [CS Core Subjects](https://www.geeksforgeeks.org/gate/gate-exam-tutorial/)
- [Interview Preparation](https://www.geeksforgeeks.org/aptitude/interview-corner/)
- [Software and Tools](https://www.geeksforgeeks.org/websites-apps/software-and-tools-a-to-z-list/)
- Courses
- [ML and Data Science](https://www.geeksforgeeks.org/courses/category/machine-learning-data-science)
- [DSA and Placements](https://www.geeksforgeeks.org/courses/category/dsa-placements)
- [Web Development](https://www.geeksforgeeks.org/courses/category/development-testing)
- [Programming Languages](https://www.geeksforgeeks.org/courses/category/programming-languages)
- [DevOps & Cloud](https://www.geeksforgeeks.org/courses/category/cloud-devops)
- [GATE](https://www.geeksforgeeks.org/courses/category/gate)
- [Trending Technologies](https://www.geeksforgeeks.org/courses/category/trending-technologies/)
- Videos
- [DSA](https://www.geeksforgeeks.org/videos/category/sde-sheet/)
- [Python](https://www.geeksforgeeks.org/videos/category/python/)
- [Java](https://www.geeksforgeeks.org/videos/category/java-w6y5f4/)
- [C++](https://www.geeksforgeeks.org/videos/category/c/)
- [Web Development](https://www.geeksforgeeks.org/videos/category/web-development/)
- [Data Science](https://www.geeksforgeeks.org/videos/category/data-science/)
- [CS Subjects](https://www.geeksforgeeks.org/videos/category/cs-subjects/)
- Preparation Corner
- [Interview Corner](https://www.geeksforgeeks.org/interview-prep/interview-corner/)
- [Aptitude](https://www.geeksforgeeks.org/aptitude/aptitude-questions-and-answers/)
- [Puzzles](https://www.geeksforgeeks.org/aptitude/puzzles/)
- [GfG 160](https://www.geeksforgeeks.org/courses/gfg-160-series)
- [System Design](https://www.geeksforgeeks.org/system-design/system-design-tutorial/)
[@GeeksforGeeks, Sanchhaya Education Private Limited](https://www.geeksforgeeks.org/), [All rights reserved](https://www.geeksforgeeks.org/copyright-information/)
![]() |
| Readable Markdown | Last Updated : 27 Aug, 2025
Electronic and digital systems use various number systems such as Decimal, Binary, Hexadecimal and Octal, which are essential in computing.
- Binary (base-2) is the foundation of digital systems.
- Hexadecimal (base-16) and Octal (base-8) are commonly used to simplify the representation of binary data.
- The Decimal system (base-10) is the standard system for everyday calculations.
- Other number systems like Duodecimal (base-12), are less commonly used but have specific applications in certain fields.

Various Number Systems
## Types of Number System
There are four common [types of number systems](https://www.geeksforgeeks.org/maths/how-many-types-of-number-systems-are-there/) based on the radix or base of the number :
### 1\. Decimal Number System
- The Decimal system is a base-10 number system.
- It uses ten digits: 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9.
- Each digit’s place value is a power of 10 (e.g., 100, 101, 102).
- It is the standard system for everyday counting and calculations.
### 2\. Binary Number System
- The Binary system is a base-2 number system.
- It uses two digits: 0 and 1.
- Each digit’s place value is a power of 2 (e.g., 20, 21, 22).
- The Binary system is the foundation for data representation in computers and [digital electronics](https://www.geeksforgeeks.org/digital-logic/digital-electronics-logic-design-tutorials/).
### 3\. Octal Number System
- The Octal system is a base-8 number system.
- It uses eight digits: 0, 1, 2, 3, 4, 5, 6 and 7.
- Each digit’s place value is a power of 8 (e.g., 80, 81, 82).
- It is often used to simplify the representation of binary numbers by grouping them into sets of three bits.
### 4\. Hexadecimal Number System
- The Hexadecimal system is a base-16 number system.
- It uses sixteen digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E and F (where A = 10, B = 11, etc.).
- Each digit’s place value is a power of 16 (e.g., 160, 161, 162).
- Hexadecimal simplifies binary by representing every 4 bits as one digit (0-F).
## Number System Conversion Methods
A number N in base or radix b can be written as:
> (N)b = dn-1 dn-2 -- -- -- -- d1 d0 . d\-1 d\-2 -- -- -- -- d\-m
In the above, dn-1 to d0 is the integer part, then follows a radix point and then d\-1 to d\-m is the fractional part.
dn-1 = Most significant bit (MSB)
d\-m = Least significant bit (LSB)

Base in Number System
### 1\. Decimal to Binary Number System Conversion
****For Integer Part:****
- Divide the decimal number by 2.
- Record the remainder (0 or 1).
- Continue dividing the quotient by 2 until the quotient is 0.
- The binary equivalent is the remainders read from bottom to top.
****For Fractional Part:****
- Multiply the fractional part by 2.
- Record the integer part (0 or 1).
- Take the fractional part of the result and repeat the multiplication.
- Continue until the fractional part becomes 0 or reaches the desired precision.
- The binary equivalent is the integer parts recorded in sequence.
****Example:**** (10.25)10

Decimal to Binary Conversion
****For Integer Part (10):****
- Divide 10 by 2 → Quotient = 5, Remainder = 0
- Divide 5 by 2 → Quotient = 2, Remainder = 1
- Divide 2 by 2 → Quotient = 1, Remainder = 0
- Divide 1 by 2 → Quotient = 0, Remainder = 1
Reading the remainders from bottom to top gives 1010.
****For Fractional Part (0.25):****
- Multiply 0.25 by 2 → Result = 0.5, Integer part = 0
- Multiply 0.5 by 2 → Result = 1.0, Integer part = 1
The fractional part ends here as the result is now 0. Reading from top to bottom gives 01.
Thus, the binary equivalent of (10.25)10 is (1010.01)2.
### 2\. Binary to Decimal Number System Conversion
****For Integer Part:****
- Write down the binary number.
- Multiply each digit by 2 raised to the power of its position, starting from 0 (rightmost digit).
- Add up the results of these multiplications.
- The sum is the decimal equivalent of the binary integer.
****For Fractional Part:****
- Write down the binary fraction.
- Multiply each digit by 2 raised to the negative power of its position, starting from -1 (first digit after the decimal point).
- Add up the results of these multiplications.
- The sum is the decimal equivalent of the binary fraction.
****Example:**** (1010.01)2
> 1x23 + 0x22 + 1x21\+ 0x20 + 0x2 \-1 + 1x2 \-2 = 8+0+2+0+0+0.25 = 10.25
Thus, (1010.01)2 = (10.25)10
### 3\. Decimal to Octal Number System Conversion
****For Integer Part:****
- Divide the decimal number by 8.
- Record the remainder (0 to 7).
- Continue dividing the quotient by 8 until the quotient is 0.
- The octal equivalent is the remainders read from bottom to top.
****For Fractional Part:****
- Multiply the fractional part by 8.
- Record the integer part (0 to 7).
- Take the fractional part of the result and repeat the multiplication.
- Continue until the fractional part becomes 0 or reaches the desired precision.
- The octal equivalent is the integer parts recorded in sequence.
****Example:**** (10.25)10
****For Integer Part (10):****
- Divide 10 by 8 → Quotient = 1, Remainder = 2
- Divide 1 by 8 → Quotient = 0, Remainder = 1
Octal equivalent = 12 (write the remainder, read from bottom to top). So, the octal equivalent of the integer part 10 is 12.
****For Fractional Part (0.25):****
- Multiply 0.25 by 8 → Result = 2.0, Integer part = 2
The fractional part ends here as the result is now 0. So, the octal equivalent of the fractional part 0.25 is 0.2.
The octal equivalent of (10.25)10 = (12.2)8
### 4\. Octal to Decimal Number System Conversion
****For Integer Part:****
- Write down the octal number.
- Multiply each digit by 8 raised to the power of its position, starting from 0 (rightmost digit).
- Add up the results of these multiplications.
- The sum is the decimal equivalent of the octal integer.
****For Fractional Part:****
- Write down the octal fraction.
- Multiply each digit by 8 raised to the negative power of its position, starting from -1 (first digit after the decimal point).
- Add up the results of these multiplications.
- The sum is the decimal equivalent of the octal fraction.
****Example:**** (12.2)8
> 1 x 81 + 2 x 80 +2 x 8\-1 = 8+2+0.25 = 10.25
Thus, (12.2)8 = (10.25)10
### 5\. Decimal to Hexadecimal Conversion
****For Integer Part:****
- Divide the decimal number by 16.
- Record the remainder (0-9 or A-F).
- Continue dividing the quotient by 16 until the quotient is 0.
- The hexadecimal equivalent is the remainders read from bottom to top.
****For Fractional Part:****
- Multiply the fractional part by 16.
- Record the integer part (0-9 or A-F).
- Take the fractional part of the result and repeat the multiplication.
- Continue until the fractional part becomes 0 or reaches the desired precision.
- The hexadecimal equivalent is the integer parts recorded in sequence.
****Example:**** (10.25)10
****Integer part:****
- 10 ÷ 16 = 0, Remainder = A (10 in decimal is A in hexadecimal)
Hexadecimal equivalent = A
****Fractional part:****
- 0\.25 × 16 = 4, Integer part = 4
Hexadecimal equivalent = 0.4
Thus, (10.25)10 = (A.4)16
### 6\. Hexadecimal to Decimal Conversion
****For Integer Part:****
- Write down the hexadecimal number.
- Multiply each digit by 16 raised to the power of its position, starting from 0 (rightmost digit).
- Add up the results of these multiplications.
- The sum is the decimal equivalent of the hexadecimal integer.
****For Fractional Part:****
- Write down the hexadecimal fraction.
- Multiply each digit by 16 raised to the negative power of its position, starting from -1 (first digit after the decimal point).
- Add up the results of these multiplications.
- The sum is the decimal equivalent of the hexadecimal fraction.
Example: (A.4)16
> (A × 160) + (4 × 16\-1) = (10 × 1) + (4 × 0.0625)
Thus, (A.4)16 = (10.25)10
### 7\. Hexadecimal to Binary Number System Conversion
To convert from Hexadecimal to Binary:
- Each hexadecimal digit (0-9 and A-F) is represented by a 4-bit binary number.

- For each digit in the hexadecimal number, find its corresponding 4-bit binary equivalent and write them down sequentially.
****Example:**** (3A)16
- (3)16 = (0011)2
- (A)16 = (1010)2
Thus, (3A)16 = (00111010)2
### 8\. Binary to Hexadecimal Number System Conversion
To convert from [Binary to Hexadecimal](https://www.geeksforgeeks.org/maths/how-to-convert-binary-to-hexadecimal/):
- Start from the rightmost bit and divide the binary number into groups of 4 bits each.
- If the number of bits isn't a multiple of 4, pad the leftmost group with leading zeros.
- Each 4-bit binary group corresponds to a single hexadecimal digit.
- Replace each 4-bit binary group with the corresponding hexadecimal digit.
****Example:**** (1111011011)2
> 0011 1101 1011
> \| \| \|
> 3 D B
Thus, (001111011011 )2 = (3DB)16
### 9\. Binary to Octal Number System
To convert from binary to octal:
- Starting from the rightmost bit, divide the binary number into groups of 3 bits.
- If the number of bits is not a multiple of 3, add leading zeros to the leftmost group.
- Each 3-bit binary group corresponds to a single octal digit.
- The binary-to-octal conversion for each 3-bit group is as follows:
| Octal | Binary Equivalent |
|---|---|
| 0 | 000 |
| 1 | 001 |
| 2 | 010 |
| 3 | 011 |
| 4 | 100 |
| 5 | 101 |
| 6 | 110 |
| 7 | 111 |
- Replace each 3-bit binary group with the corresponding octal digit.
****Example:**** (111101101)2
> 111 101 101
> \| \| \|
> 7 5 5
Thus, (111101101)2 = (755)8
### 10\. Octal to Binary Number System Conversion
To convert from octal to binary:
- Each octal digit (0-7) corresponds to a 3-bit binary number.
- For each octal digit, replace it with its corresponding 3-bit binary equivalent.
****Example:**** (153)8
- Break the octal number into digits: 1, 5, 3
- Convert each digit to binary:
- 1 in octal = 001 in binary
- 5 in octal = 101 in binary
- 3 in octal = 011 in binary
Thus, (153)8 = (001101011)2 |
| Shard | 103 (laksa) |
| Root Hash | 12046344915360636903 |
| Unparsed URL | org,geeksforgeeks!www,/digital-logic/number-system-and-base-conversions/ s443 |