CoderTools

Base Converter

Convert between binary, octal, decimal, and hexadecimal number systems with custom base support (2-36)

Enter a value in any field to instantly see conversions to all other number bases.

Number Base Converter Documentation

What is a Number Base (Radix)?

A number base, or radix, defines how many unique digits are used to represent numbers in a positional numeral system. The most common base in everyday life is decimal (base 10), using digits 0-9. Computers primarily use binary (base 2), while programmers frequently work with hexadecimal (base 16) and octal (base 8) for more compact representation of binary data.

Common Number Systems

Base Name Digits Common Usage
2 Binary 0, 1 Digital circuits, computer memory, machine code
8 Octal 0-7 Unix file permissions, legacy computing systems
10 Decimal 0-9 Everyday mathematics, human-readable numbers
16 Hexadecimal 0-9, A-F Memory addresses, color codes (CSS/HTML), byte representation

How Base Conversion Works

Converting a number from one base to another involves two main steps:

  1. Convert the source number to decimal (base 10) by multiplying each digit by its positional value (base^position) and summing all values
  2. Convert the decimal result to the target base using repeated division - divide by the target base and collect remainders
  3. Read the remainders in reverse order to get the final result in the target base

Conversion Example

Binary 1101 → Decimal: (1×8) + (1×4) + (0×2) + (1×1) = 13

Each binary digit position represents a power of 2: from right to left, 2⁰=1, 2¹=2, 2²=4, 2³=8, etc.

Quick Reference Table (0-15)

Decimal Binary Octal Hexadecimal

Common Use Cases

  • Programming: Debug memory addresses, understand bitwise operations, work with low-level data
  • Web Development: Convert CSS/HTML color codes between RGB decimal and hexadecimal formats
  • Networking: Understand IP addresses, subnet masks, and MAC addresses in different formats
  • Digital Electronics: Analyze logic circuits, understand binary arithmetic
  • Data Analysis: Work with encoded data, parse binary file formats

Tips & Tricks

  • Hex digits A-F represent decimal values 10-15. 0xFF equals 255 in decimal.
  • Each hex digit represents exactly 4 binary digits (bits), making hex a convenient shorthand for binary.
  • This tool uses BigInt for arbitrary precision, allowing conversion of very large numbers without precision loss.