HomeConvertersNumbersNumber Base Converter

Number Base Converter

Numbers

Convert numbers between decimal, binary, octal, and hexadecimal instantly. Essential for Indian CS students, programmers, and electronics engineers.

Decimal0d
DEC · Base 10
Binary0b
BIN · Base 2
Octal0o
OCT · Base 8
Hexadecimal0x
HEX · Base 16

What is a Number Base?

The Number Base Converter converts integers between the four positional numeral systems used in computing and mathematics: decimal (base 10), binary (base 2), octal (base 8), and hexadecimal (base 16).

Each system represents numbers using a different set of digit symbols and assigns different positional weights to each digit:

  • Decimal (base 10) — digits 0–9; positions represent powers of 10 (1, 10, 100, 1000…). The system all humans use for everyday counting and arithmetic.
  • Binary (base 2) — digits 0 and 1; positions represent powers of 2 (1, 2, 4, 8, 16…). The native language of all digital computers and processors.
  • Octal (base 8) — digits 0–7; positions represent powers of 8 (1, 8, 64, 512…). Used in Unix/Linux file permissions and older computer architectures.
  • Hexadecimal (base 16) — digits 0–9 and A–F; positions represent powers of 16 (1, 16, 256…). Used for memory addresses, colour codes, and CPU registers because one hex digit encodes exactly four binary bits.

For Indian students and engineers, these conversions appear constantly: in GATE computer science and electronics papers, in B.Tech Digital Logic Design courses, in assembly language programming, and in networking (IP addresses, subnet masks). The four systems coexist because different layers of the computing stack — hardware, operating system, and application — each naturally express values in the most compact form available to them.

Pair this converter with the Data Storage Converter when you need to relate binary bit patterns to storage capacity, or with the Data Transfer Converter when working with bandwidth expressed in binary multiples.

How to use this Number Base calculator

  1. Select the FROM base in the left panel dropdown — for example, "Decimal (Base 10)" if you have a number written in standard decimal notation.
  2. Select the TO base in the right panel dropdown — for example, "Binary (Base 2)" to see the binary equivalent.
  3. Enter your integer in the input field on the left — the converted value appears instantly on the right. Only non-negative integers are supported; decimal fractions and negative numbers are truncated to their integer part.
  4. Use the ⇅ swap button to reverse the conversion — useful when you have a binary number and want to convert it back to decimal.
  5. Check the reference table below the panels to see your value expressed in all four bases simultaneously — decimal, binary, octal, and hexadecimal in one view.
  6. Interpret the result — if you are converting for an exam, verify by re-entering the result as FROM and checking it converts back to your original number. If converting for a programming task, cross-check against your language's built-in formatter (bin() in Python, toString(2) in JavaScript).

Formula & Methodology

Canonical form: Decimal integer. All conversions pass through the decimal representation as an intermediate step.

Conversion formulas:

### Decimal → Binary (repeated division by 2)
Divide the decimal number by 2 repeatedly, recording remainders. Read remainders from bottom to top.

Example: Decimal 42 → Binary
42 ÷ 2 = 21  R 0 21 ÷ 2 = 10  R 1 10 ÷ 2 =  5  R 0  5 ÷ 2 =  2  R 1  2 ÷ 2 =  1  R 0  1 ÷ 2 =  0  R 1
Read upward: 101010 ✓ (verify: 32+8+2 = 42)

### Binary → Decimal (sum of positional weights)
Multiply each binary digit by its positional power of 2 and sum.

1×2⁵ + 0×2⁴ + 1×2³ + 0×2² + 1×2¹ + 0×2⁰ = 32+0+8+0+2+0 = 42

### Decimal → Octal (repeated division by 8)
Same method as binary but divide by 8. Decimal 42: 42÷8=5 R2, 5÷8=0 R5 → Octal 52 ✓ (verify: 5×8+2 = 42)

### Binary → Octal (group by 3 bits)
Group binary digits in sets of 3 from the right. Convert each group to its octal digit.

101 0105 2 → Octal 52

### Decimal → Hexadecimal (repeated division by 16)
Divide by 16; replace remainders 10–15 with A–F. Decimal 42: 42÷16=2 R10 → R10 = A → Hex 2A

### Binary → Hexadecimal (group by 4 bits)
Group binary digits in sets of 4 from the right. Convert each group (0–15) to its hex digit.

0010 10102 A → Hex 2A

Indian GATE worked example:

Convert octal 237 to decimal:
- Digits from right: 7×8⁰ + 3×8¹ + 2×8² = 7 + 24 + 128 = 159

Enter 237 in the converter with FROM=Octal, TO=Decimal → instantly shows 159. Then check binary: binary 10011111 → 128+16+8+4+2+1 = 159 ✓
Frequently Asked Questions
What is a Number Base Converter?
A Number Base Converter is a tool that converts integers between different positional numeral systems — decimal (base 10), binary (base 2), octal (base 8), and hexadecimal (base 16). Each system uses a different number of symbols to represent values: decimal uses 0–9, binary uses only 0 and 1, octal uses 0–7, and hexadecimal uses 0–9 plus A–F. These systems coexist because computers process data in binary, programmers read memory in hexadecimal, and humans calculate in decimal.
What is the difference between binary and decimal?
Decimal (base 10) is the positional numeral system humans use daily, with digit positions representing powers of 10 — ones, tens, hundreds, and so on. Binary (base 2) uses only 0 and 1, with positions representing powers of 2 — 1, 2, 4, 8, 16. Every digital computer stores and processes data in binary because electronic circuits have two stable states (on/off, high/low voltage). Decimal 42 in binary is 101010, because 32+8+2 = 42.
What is hexadecimal and why is it used in computing?
Hexadecimal (base 16) uses sixteen symbols — 0–9 for values zero through nine, and A–F for values ten through fifteen. Its primary advantage is compactness: one hex digit represents exactly four binary bits, so a byte (8 bits) can always be written as exactly two hex digits. Memory addresses, colour codes (HTML/CSS), and CPU register values are all expressed in hexadecimal because it is far more readable than long binary strings — 0xFF is easier to read than 11111111.
What is octal and where is it used?
Octal (base 8) uses digits 0–7. Each octal digit represents exactly three binary bits, making it compact for certain systems. Octal was heavily used on older IBM mainframes and minicomputers and survives today primarily in Unix/Linux file permissions — the command `chmod 755` uses octal digits where 7=111 (binary: read+write+execute), 5=101 (read+execute). Octal is also featured prominently in Indian GATE, UPSC technical, and computer science entrance exams.
What is the formula for converting decimal to binary?
Repeatedly divide the decimal number by 2 and record the remainders from bottom to top. For decimal 42: 42÷2=21 R0, 21÷2=10 R1, 10÷2=5 R0, 5÷2=2 R1, 2÷2=1 R0, 1÷2=0 R1. Reading remainders upward: 101010. Verify: 1×32 + 0×16 + 1×8 + 0×4 + 1×2 + 0×1 = 32+8+2 = 42 ✓. The Number Base Converter performs this automatically for any integer.
How do I convert decimal to binary?
On the Number Base Converter, select 'Decimal (Base 10)' in the FROM field and 'Binary (Base 2)' in the TO field. Enter your decimal integer in the input box — the binary equivalent updates instantly. For example, entering 255 gives 11111111 (eight 1s, representing one full byte). The reference table below simultaneously shows the same value in all four bases: decimal, binary, octal, and hexadecimal.
How do I convert binary to octal?
The fastest manual method is to group the binary digits in sets of three from the right and convert each group to its octal equivalent (000=0, 001=1, 010=2, 011=3, 100=4, 101=5, 110=6, 111=7). For binary 101010: groups are 101 and 010, giving octal 52. On the Number Base Converter, select Binary as FROM and Octal as TO — enter 101010 and get 52 instantly without grouping by hand.
How do I use the Number Base Converter?
Select the source number system in the FROM field (e.g. Decimal), then select the target system in the TO field (e.g. Binary). Enter your integer value in the input box on the left — the converted value updates in real time. Use the ⇅ swap button to reverse the conversion direction. The reference table shows your input simultaneously in decimal, binary, octal, and hexadecimal, letting you see all representations at once. Note: hex values using letters A–F require numeric-only entry — enter those as their decimal equivalent in the FROM decimal field.
Where is binary used in Indian CS and engineering curricula?
Binary is foundational across several Indian engineering streams. In computer science and IT programmes (B.Tech, BCA, B.Sc CS), binary is taught in first-year Digital Logic Design and Computer Organisation courses and is tested in GATE CSE. In electronics engineering, binary underpins Boolean algebra, logic gates, and flip-flops. In UPSC and state PSC technical exams, number system conversions — especially decimal↔binary and decimal↔hexadecimal — are standard questions. Paired with the [Data Storage Converter](/data-storage-converter/), binary understanding helps explain how storage capacity is measured in bits and bytes.
What number systems are used in digital electronics in India?
Indian electronics and electrical engineering syllabi (Anna University, VTU, Mumbai University, AKTU) cover all four number systems in first-year courses: decimal for human calculations, binary for logic and processor design, octal for compact binary representation and Unix permissions, and hexadecimal for memory addressing and assembly language. GATE ECE and IN (Instrumentation) papers regularly test number system conversions and binary arithmetic (addition, subtraction using 2's complement).
What is decimal 42 in binary, octal, and hexadecimal?
Decimal 42 converts to binary 101010 (32+8+2=42), octal 52 (5×8+2=42), and hexadecimal 2A (2×16+10=42). The binary representation shows exactly which powers of 2 sum to 42. The octal value 52 is the most compact representation using only standard digits. The hex value 2A cannot be displayed in a numeric input field — this is a known limitation of the standard converter interface, so hex values using A–F are best calculated manually or via a dedicated string-input hex tool.
What is binary 11111111 in decimal and hexadecimal?
Binary 11111111 equals decimal 255 (128+64+32+16+8+4+2+1 = 255) and hexadecimal FF. This is one of the most important binary values in computing: it represents the maximum value of an unsigned 8-bit integer (one byte), the IP subnet mask 255.255.255.255, and the colour #FFFFFF (pure white) in web design. Knowing that 8 ones in binary always equal 255 in decimal is a foundational fact in computer networking and graphics — covered in depth alongside the [Data Transfer Converter](/data-transfer-converter/) for bandwidth calculations.