Number Base Converter

Convert any number between binary (base 2), octal (base 8), decimal (base 10), hexadecimal (base 16), and more. Shows all bases simultaneously.

enter a number
Input number
Input base (from)

How to Use the Number Base Converter

  1. Enter your number — type the value you want to convert.
  2. Select the input base — choose binary (2), octal (8), decimal (10), hexadecimal (16), or any custom base from 2 to 36.
  3. Read all conversions — see the number expressed in all common bases simultaneously.
  4. Convert to custom base — enter any base from 2 to 36 for specialised conversions.
  5. Use for programming — convert between the four primary programming bases (binary, octal, decimal, hex) for bit manipulation, colour codes, and system programming work.
🔢 Base 36 maximum: Base 36 uses all 10 digits (0-9) plus all 26 letters (A-Z), giving 36 possible characters per position. This is the maximum base that maps cleanly to alphanumeric characters. Base 36 is used for compact identifiers: timestamp in base 36 is shorter than decimal, useful for short URL systems and compact unique IDs.

Understanding Positional Number Systems

📐 How Bases Work
In any base N, there are N possible digits (0 to N-1). Position value = digit × N^position. Base 10: 234 = 2×100 + 3×10 + 4×1. Base 2: 1010 = 1×8 + 0×4 + 1×2 + 0×1 = 10. Base 16: 1A = 1×16 + 10×1 = 26. Same concept, different N.
💻 Programming Base Usage
Decimal (base 10): human arithmetic, most calculations. Binary (base 2): bitwise operations, hardware interfaces, boolean logic. Octal (base 8): Unix permissions (chmod 755), legacy systems. Hexadecimal (base 16): colour codes, memory addresses, hash values, byte representation.
🔄 Conversion Method
To convert any base to decimal: multiply each digit by its position value (base^position) and sum. To convert decimal to any base: repeatedly divide by the base, collect remainders in reverse order. To convert between non-decimal bases: convert to decimal first, then to target base (or use direct algorithms for binary↔hex and binary↔octal).
⚡ Binary ↔ Hex Shortcut
One hex digit = exactly 4 binary bits. Convert by groups of 4: 11001010 in binary = 1100 | 1010 = C | A = CA in hex. Reverse: CA hex = 1100 | 1010 = 11001010 binary. This direct relationship makes hex a convenient shorthand for binary that programmers use constantly.
🔵 Floating Point
Floating point numbers (decimals) in binary use the IEEE 754 standard. 0.1 in decimal cannot be represented exactly in binary (just as 1/3 cannot be represented exactly in decimal). This causes the infamous 0.1 + 0.2 = 0.30000000000000004 in JavaScript and most languages. Understanding this explains common precision bugs in financial and scientific calculations.
🌐 Base 64 vs Base 36
Base 64 (used in Base64 encoding) uses uppercase, lowercase, digits, and two special characters (+/). Unlike bases 2-36 which map to standard alphanumeric characters, base 64 is a separate encoding system. Base 36 (0-9, A-Z) is the highest base using only standard alphanumeric characters — useful for compact IDs in URLs and databases.

Number Bases in System Programming

Bitwise operations and binary

System programmers and embedded developers work in binary constantly. Setting a bit: value |= (1 << bit_position). Clearing a bit: value &= ~(1 << bit_position). Toggling a bit: value ^= (1 << bit_position). Checking a bit: (value >> bit_position) & 1. These operations manipulate individual bits for hardware registers, protocol flags, and packed data structures. Seeing values in binary makes these operations intuitive.

Hex in memory and debugging

Memory dumps, core files, and debugging output use hexadecimal because it is the most compact human-readable representation of binary data. One hex digit = 4 bits = one nibble. Two hex digits = 8 bits = one byte. Four hex digits = 16 bits = one word. Eight hex digits = 32 bits = one double word. A 32-bit memory address like 0x7FFF5FBF8B30 is immediately understandable in size and structure to an experienced developer in a way that its decimal equivalent (140734799208240) is not.

Base conversion in everyday development

Everyday base conversion scenarios: colour manipulation (adding/subtracting from hex colour values), understanding IP addresses and subnet masks in binary, reading HTTP status codes (often referenced in hex in logs), file permission management (octal), hash comparison (hex), and database storage optimisation (storing flags as binary integers rather than boolean columns). Each of these contexts requires comfortable movement between bases.

🔢 Base conversion mental shortcuts: Decimal→Hex: look up each byte in a hex table (00-FF). Hex→Binary: each digit expands to 4 bits (F=1111). Binary→Octal: group bits by 3 from right. Octal→Binary: each digit expands to 3 bits. For anything more complex, use this converter. The shortcuts are useful for quick sanity checks; precise conversions require a tool.

Frequently Asked Questions

What is binary?
Binary (base 2) uses only 0s and 1s. It's the fundamental language of computers because transistors have two states: on (1) and off (0). The decimal number 255 = 11111111 in binary (eight 1s), which is why byte values range from 0–255 (8 bits).
What is hexadecimal used for?
Hexadecimal (base 16) uses digits 0–9 and letters A–F. It's used in programming because it compactly represents binary — each hex digit = 4 bits. Used for memory addresses, colour codes (#FF6600), CSS, HTML, and network MAC addresses.
Why is base 36 useful?
Base 36 uses digits 0–9 and letters A–Z. It's the most compact way to represent numbers using standard alphanumeric characters. Used for URL shorteners (like bit.ly), unique ID generation, and encoding large numbers into short strings.