General Utility

Number Base Converter

Convert numbers between binary (base 2), octal (base 8), decimal (base 10), hexadecimal (base 16), and any custom base.

Custom Base Conversion
About this calculator

Number base conversion is one of those things that comes up constantly in programming and computer science but requires looking up the procedure every time if you do not work with it daily. Binary for bitwise operations, hex for memory addresses and color codes, octal for Unix file permissions. Having the conversion immediate removes a small but real friction from development work.

Hex color codes are just RGB values in hexadecimal. #FF0000 is R=255 (FF in hex), G=0, B=0. #4B4845 is R=42 (2a), G=40 (28), B=37 (25). Converting between hex and decimal is a daily task for any front-end developer.

Why computers use binary

Computer hardware represents data as electrical signals: on or off, high or low voltage. These two states map naturally to binary (0 and 1). All computation, from simple arithmetic to complex AI, ultimately reduces to manipulating binary bits. Humans use decimal because we have ten fingers; computers use binary because transistors have two states.

Hexadecimal as binary shorthand

Hexadecimal (base 16) is useful because each hex digit represents exactly 4 binary bits. Two hex digits represent a byte (8 bits) precisely. Writing a 32-bit integer as 8 hex digits is far more readable than 32 binary digits. This is why memory addresses, color codes, and SHA hashes are displayed in hex. Converting between hex and binary is mechanical: each hex digit maps directly to a 4-bit group.

Common conversions to know

Binary 1111 = Decimal 15 = Hex F. Binary 1000 0000 = Decimal 128 = Hex 80. Decimal 255 = Hex FF = Binary 1111 1111 (a fully set byte). Hex 0x0A = Decimal 10. Unix file permissions are in octal: 755 means rwxr-xr-x (owner: read/write/execute, group/others: read/execute).

Frequently asked questions

What is base 36?

Base 36 uses digits 0-9 and letters A-Z (case insensitive), providing 36 symbols. It is used to create compact representations of large numbers in URLs, short IDs, and identifier systems where readability matters. A base 36 number is more compact than decimal while remaining human-readable without the potentially confusing characters of base 64.

What does "0x" prefix mean?

"0x" is a convention in most programming languages to indicate a hexadecimal literal. 0xFF = decimal 255. Similarly, "0b" indicates binary (0b1010 = 10) and "0o" indicates octal (0o12 = 10) in many languages.

Related calculators