> For the complete documentation index, see [llms.txt](https://www.pranaypourkar.co.in/the-programmers-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.pranaypourkar.co.in/the-programmers-guide/algorithm/bit-manipulation/number-system.md).

# Number System

## About

Number systems are methods for representing numbers in a consistent manner. They are essential for various fields, including mathematics, computer science, and engineering. There are 4 commonly used system i.e. Decimal, Binary, Octal, and Hexadecimal.

## Decimal Number System (Base 10)

### **Overview:**

* The most common number system used in daily life.
* Base 10 system, which means it has 10 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9.
* Each digit's position in a number has a value that is a power of 10.

### **Example:**

* The number 345 in decimal can be expressed as:

<figure><img src="/files/zPwRIjpo6KoKSI5jG48F" alt="" width="266"><figcaption></figcaption></figure>

### **Usage:**

* Used universally in everyday arithmetic and counting.

### Conversion:

<figure><img src="/files/jUHQNxR7fKXraoD1jfs5" alt="" width="563"><figcaption></figcaption></figure>

## Binary Number System (Base 2)

### **Overview:**

* Used primarily in computing and digital electronics.
* Base 2 system, with only two digits: 0 and 1.
* Each digit's position in a number has a value that is a power of 2.

### **Example:**

* The binary number 1011 can be expressed as

<figure><img src="/files/pXVkOU8lt18kSXQnZkiz" alt="" width="461"><figcaption></figcaption></figure>

### **Usage:**

* Binary code is the fundamental language of computers.
* Used in digital circuits and data representation in computers.

### Conversion:

<figure><img src="/files/8VHEC3IePis1cGsd1ARq" alt="" width="563"><figcaption></figcaption></figure>

## Octal Number System (Base 8)

### **Overview:**

* Base 8 system, with eight digits: 0, 1, 2, 3, 4, 5, 6, and 7.
* Each digit's position in a number has a value that is a power of 8.
* Group by 3 bits i.e. (2^3 = 8) in a binary number.

### **Example:**

* The octal number 345 can be expressed as:

<figure><img src="/files/uy275mOcYVGfuwLDwgXX" alt="" width="400"><figcaption></figcaption></figure>

### **Usage:**

* Sometimes used in computing as a more compact representation of binary-coded values.
* Historically significant in early computing systems.

### Conversion:

<figure><img src="/files/2BrexG97HUU4gFM2Sa4I" alt="" width="563"><figcaption></figcaption></figure>

## Hexadecimal Number System (Base 16)

### **Overview:**

* Base 16 system, with sixteen digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F.
* Each digit's position in a number has a value that is a power of 16.
* Group by 4 bits i.e. (2^4 = 16) in a binary number.

### **Example:**

* The hexadecimal number 1A3 can be expressed as:

<figure><img src="/files/k9y6UmnXS9CUiZvtMtDN" alt="" width="458"><figcaption></figcaption></figure>

### **Usage:**

* Widely used in computer science and programming.
* Handy for representing large binary values compactly, such as memory addresses and color codes in web design.

### Conversion:

<figure><img src="/files/RGHA36FJeEvLn0LdTSz8" alt="" width="563"><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://www.pranaypourkar.co.in/the-programmers-guide/algorithm/bit-manipulation/number-system.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
