🔢

Number Base Converter

Convert numbers between binary, octal, decimal and hexadecimal instantly. Free, private.

💻 Developer Tools Free Browser-based
Tool

Type a number in any field — all other bases update instantly.

Number Base Reference

DecimalBinaryOctalHex
0000000
81000108
10101012A
15111117F
161 00002010
2551111 1111377FF
2561 0000 0000400100

Why Hexadecimal in Programming?

Hex is popular because it maps cleanly to binary: each hex digit represents exactly 4 bits. A full byte (8 bits) is always two hex digits — making memory addresses, color codes and bitmasks far easier to read than their binary equivalents. 0xFF is immediately readable as "max byte value"; the binary equivalent 11111111 requires counting eight ones. CSS colors use hex (#1A2B3C), network masks use hex, and debug output from low-level tools is always hex.

When You Encounter Each Base

  • Binary — CPU instruction sets, bitfields, permission flags (e.g. Unix file permissions), network protocol documentation, embedded systems.
  • Octal — Unix file permission notation (chmod 755 = rwxr-xr-x), legacy systems, C/C++ octal literals (prefix 0).
  • Decimal — everyday arithmetic, IP addresses in human-readable form, database integer IDs, all user-facing numbers.
  • Hexadecimal — CSS colors, HTML color codes, memory addresses, SHA/MD5 hash outputs, UUID segments, HTTP headers, ASCII and Unicode code points.

Converting Between Bases by Hand

To convert decimal to binary: repeatedly divide by 2, write the remainders in reverse order. 13 ÷ 2 = 6 r1 → 3 r0 → 1 r1 → 0 r1, read remainders bottom to top: 1101. To convert binary to hex: group bits into sets of 4 from the right and replace each group with its hex digit. 1101 1010D and A0xDA.

Frequently Asked Questions