Converter

Number Base Converter

Convert numbers between any base from 2 to 36. See binary, octal, decimal, hex, and custom base results with step-by-step conversion.

Quick Answer

Decimal 255 = Binary 11111111 = Octal 377 = Hex FF. Each hex digit maps to exactly 4 binary digits. Enter any number and base to convert.

Binary (2)0b11111111
Octal (8)0o377
Decimal (10)255
Hex (16)0xFF
Base 52010

Decimal value: 255

Bits needed: 8

Bytes needed: 1

Is power of 2: No

About This Tool

The Number Base Converter is a versatile tool for developers, students, and anyone working with different numeral systems. It converts any number from one base (radix) to another, supporting all bases from 2 to 36. The tool simultaneously shows the input in binary, octal, decimal, hexadecimal, and a custom base of your choice, with an optional step-by-step breakdown of the conversion process.

Understanding Number Bases

A number base (or radix) defines how many unique digit symbols are used in a positional numeral system. The most familiar is base 10 (decimal), which uses the ten symbols 0 through 9. In any positional system, each digit position represents a successive power of the base. For decimal, the rightmost digit is the ones place (10^0), the next is the tens place (10^1), then hundreds (10^2), and so on. The same principle applies to every base: in binary (base 2), each position represents a power of 2 (1, 2, 4, 8, 16...), and in hexadecimal (base 16), each position represents a power of 16 (1, 16, 256, 4096...).

Binary: The Language of Computers

Binary (base 2) is the foundation of all digital computing. Every processor instruction, every byte of memory, and every pixel on your screen is ultimately represented in binary. The two binary digits (0 and 1) correspond directly to the two electrical states in a digital circuit: off and on. Understanding binary is essential for working with bitwise operations, network protocols, file formats, and low-level programming. Common binary groupings include nibbles (4 bits), bytes (8 bits), words (16/32/64 bits depending on architecture), and kilobytes (1024 bytes).

Hexadecimal: The Developer's Shorthand

Hexadecimal (base 16) uses digits 0-9 and letters A-F to represent values 0-15. Its primary advantage is that each hex digit maps to exactly 4 binary digits, making it a compact way to represent binary data. A byte (8 bits) is always exactly 2 hex digits: 00 to FF (0 to 255 in decimal). This is why hex is used for CSS color codes (#FF5733), memory addresses (0x7FFF0000), Unicode code points (U+00E9), and byte-level data inspection in hex editors and debuggers. Hex is also standard in cryptographic hashes (SHA-256 produces a 64-character hex string) and MAC addresses.

Octal and Other Bases

Octal (base 8) was historically important in early computing when architectures used word sizes that were multiples of 3 bits. Today, its most visible use is in Unix/Linux file permissions: chmod 755 sets read-write-execute (7=111 binary) for the owner, read-execute (5=101 binary) for group and others. Base 36 uses all alphanumeric characters (0-9, A-Z) and is useful for generating compact, human-readable identifiers. Base 64, while beyond our converter's scope, is ubiquitous in encoding binary data for email (MIME), data URLs, and JSON Web Tokens (JWT).

Step-by-Step Conversion Process

Our converter shows the step-by-step process of converting to binary using the successive division method. To convert a decimal number to any target base, you repeatedly divide by the base and collect the remainders. For example, converting decimal 42 to binary: 42/2=21 remainder 0, 21/2=10 remainder 1, 10/2=5 remainder 0, 5/2=2 remainder 1, 2/2=1 remainder 0, 1/2=0 remainder 1. Reading the remainders from bottom to top gives 101010. This educational feature helps students and developers understand the mechanics of base conversion rather than just seeing the result.

Frequently Asked Questions

What is a number base (radix)?
A number base, or radix, determines how many unique digits are used in a positional numeral system. Base 10 (decimal) uses digits 0-9, base 2 (binary) uses 0-1, base 8 (octal) uses 0-7, and base 16 (hexadecimal) uses 0-9 plus A-F. Each digit position represents a power of the base. For example, in base 10, the number 255 means 2x10^2 + 5x10^1 + 5x10^0 = 200 + 50 + 5. In base 16, FF means 15x16^1 + 15x16^0 = 240 + 15 = 255. Any positive integer greater than 1 can serve as a base.
Why is binary important in computing?
Binary (base 2) is the fundamental language of computers because digital circuits have two states: on (1) and off (0). Every piece of data in a computer, whether text, images, video, or programs, is ultimately stored and processed as sequences of binary digits (bits). A single bit can represent two values, 8 bits (a byte) can represent 256 values (0-255), and so on. Understanding binary helps in debugging, understanding memory layouts, working with bitwise operations, and comprehending how computers represent negative numbers, floating-point values, and character encodings.
Why do programmers use hexadecimal?
Hexadecimal (base 16) is popular in programming because it provides a compact representation of binary data. Each hex digit corresponds to exactly 4 binary digits (bits), so a byte (8 bits) can be represented as exactly 2 hex digits. This makes hex ideal for memory addresses, color codes (#FF5733), MAC addresses (00:1A:2B:3C:4D:5E), and byte-level data inspection. Hex is easier to read and type than long binary strings: the binary number 11111111 is simply FF in hex. Most programming languages use the 0x prefix to indicate hex numbers (e.g., 0xFF = 255).
How do you convert between bases manually?
To convert from any base to decimal (base 10), multiply each digit by its positional power of the base and sum the results. For example, binary 1101 = 1x2^3 + 1x2^2 + 0x2^1 + 1x2^0 = 8 + 4 + 0 + 1 = 13. To convert from decimal to another base, repeatedly divide by the target base and collect the remainders in reverse order. For example, 13 / 2 = 6 remainder 1, 6 / 2 = 3 remainder 0, 3 / 2 = 1 remainder 1, 1 / 2 = 0 remainder 1. Reading remainders bottom-to-top gives 1101. To convert between two non-decimal bases, convert to decimal first as an intermediate step.
What bases beyond 16 are commonly used?
Base 8 (octal) is used in Unix file permissions (chmod 755). Base 36 uses all digits 0-9 and letters A-Z, making it the maximum base that can be represented with standard alphanumeric characters. It is used for compact URL shorteners and unique identifiers. Base 32 (RFC 4648) is used in some encoding schemes like Crockford's Base32 for human-readable identifiers. Base 64 is widely used for encoding binary data as ASCII text in email attachments (MIME), data URLs, and JWT tokens, though it uses a custom character set beyond 0-9 and A-Z. Base 58 (Bitcoin's Base58Check) excludes visually ambiguous characters like 0, O, I, and l.
What is the largest base this converter supports?
This converter supports bases from 2 through 36. Base 36 is the practical maximum when using standard alphanumeric characters (0-9 for digits 0-9 and A-Z for digits 10-35). Beyond base 36, you would need additional symbols, and there is no universal standard for what those symbols should be. For most practical purposes, bases 2 (binary), 8 (octal), 10 (decimal), and 16 (hex) cover the vast majority of use cases. Our custom base option lets you explore any base from 2 to 36 to understand how different number systems work.

Was this tool helpful?