Number Base Converter

Convert between binary, octal, decimal, hex and any custom base (2–36) — with bit view & two's complement

Convert Number

Type in any field — all others update instantly

Quick Reference (0–15)

Dec Bin Oct Hex Char

Base Reference

  • Base 2 — Binary (0,1)
  • Base 8 — Octal (0–7)
  • Base 10 — Decimal (0–9)
  • Base 16 — Hex (0–9, A–F)
  • Base 32 — 0–9, A–V
  • Base 36 — 0–9, A–Z

Tips

  • Prefix 0x for hex input
  • Prefix 0b for binary
  • Prefix 0o for octal
  • Click any result to copy
  • Negative numbers supported

Free Number Base Converter

Convert integers between any number bases from binary (base 2) to hexadecimal (base 16) and beyond, up to base 36. Features a real-time bit visualiser showing individual bit states in 8, 16, 32 and 64-bit representations, plus step-by-step conversion explanations for learning.

Features

Simultaneous Conversion

All four standard bases (binary, octal, decimal, hex) update simultaneously as you type.

Any Base (2–36)

Convert to any base from 2 to 36. Base 32 and 36 use alphanumeric digits (A–Z).

Bit Visualiser

See individual bits highlighted in 8, 16, 32 and 64-bit layouts with a count of set bits.

All Representations

View every representation simultaneously: two's complement, scientific notation, octal and more.

Step-by-Step

Detailed division algorithm walkthrough shows exactly how the conversion is performed.

Quick Reference

Interactive 0–15 reference table — click any row to load that number instantly.

Who Uses This Tool?

CS StudentsLearn binary, octal and hexadecimal number systems with visual bit representations.
ProgrammersConvert memory addresses, bitmasks and colour values between decimal and hex.
Network EngineersWork with IP addresses, subnet masks and port numbers in multiple bases.
Hardware EngineersConvert between decimal values and their binary/hex register representations.

Frequently Asked Questions

Why is hexadecimal used in programming?
Hex provides a compact representation of binary data — one hex digit represents exactly 4 bits (a nibble). This makes it easy to read binary values: FF hex = 11111111 binary = 255 decimal.
What is two's complement?
Two's complement is the standard way computers represent negative integers in binary. A negative number is represented by inverting all bits and adding 1. This is why -1 in 8-bit two's complement is 11111111.
What is the largest number that fits in 32 bits?
An unsigned 32-bit integer holds values from 0 to 4,294,967,295 (2³²-1). A signed 32-bit integer holds -2,147,483,648 to 2,147,483,647. This is why the Y2K38 problem occurs at timestamp 2,147,483,647.
What is base 36 used for?
Base 36 uses digits 0–9 and letters A–Z, producing compact alphanumeric representations. It is used for URL shorteners, referral codes and any system needing short, readable unique identifiers.

Pro Tip

When working with HTML colour codes, you're using hexadecimal! #FF5733 means Red=255 (FF), Green=87 (57), Blue=51 (33) in decimal. Use this tool to convert any colour component between hex and decimal instantly.

Did You Know?

Base 2
Why Computers Use Binary
Computers use binary because transistors have two stable states: on (1) and off (0). This maps perfectly to binary digits. Attempting to use base-10 electrically would require 10 distinct voltage levels — far harder to distinguish reliably in hardware.
0xFF0000
Your Favourite Red Colour
CSS colour #FF0000 is red. Each pair of hex digits is one byte (0–255). FF = 255 in decimal. So #FF0000 means Red=255, Green=0, Blue=0. Hex is used in colour codes because one byte (255 values) maps perfectly to exactly two hex digits — much cleaner than three decimal digits.
Base 60
Why 60 Minutes in an Hour
The ancient Sumerians used a base-60 number system (sexagesimal) around 3,000 BC. This is why we have 60 seconds per minute, 60 minutes per hour, and 360 degrees (6×60) in a circle. Base 60 is highly divisible — it divides evenly by 2, 3, 4, 5, 6, 10, 12, 15, 20 and 30.

Number Systems Quick Reference

BaseNameDigits UsedPrefixCommon Use
2Binary0, 10bCPU, networking, data storage
8Octal0–70oUnix permissions, legacy systems
10Decimal0–9(none)Human counting, money
16Hexadecimal0–9, A–F0xColours, memory, cryptography
32Base 320–9, A–V(varies)URL shorteners, encoding
36Base 360–9, A–Z(varies)Short IDs, URL-safe encoding
60Sexagesimal0–59(ancient)Time, angles (historical)

More Questions

Why is hexadecimal so common in programming?
One hex digit represents exactly 4 bits (a nibble). Two hex digits represent one byte (8 bits, 0–255). This makes hex a compact, human-readable representation of binary data. Memory addresses, colour codes, MAC addresses, error codes and cryptographic hashes are all expressed in hex because it compresses binary data by 4× while remaining reversible without arithmetic.
What is two's complement and why do computers use it?
Two's complement is the standard way to represent negative integers in binary. A negative number is formed by inverting all bits and adding 1. For example, -1 in 8-bit two's complement is 11111111. The advantage: addition and subtraction work identically for positive and negative numbers — no special circuitry needed. Alternative representations like sign-magnitude and one's complement require extra logic.
What is the difference between bits, nibbles, bytes and words?
1 bit = single binary digit (0 or 1). 4 bits = 1 nibble = 1 hex digit. 8 bits = 1 byte = 2 hex digits (range 0–255). 16 bits = 1 word (on 16-bit systems). 32 bits = 1 double word (DWORD) on 32-bit systems. 64 bits = 1 quadword on 64-bit systems. File sizes and memory are measured in bytes; network speeds are measured in bits (hence Mbps vs MBps — factor of 8 difference).

Common Mistakes

Confusing bit and byte speeds
Internet speeds are advertised in megabits (Mb/s) but files are measured in megabytes (MB). 100 Mbps internet = ~12.5 MB/s download speed — always divide by 8.
Remember: lowercase b = bits, uppercase B = bytes. 1 byte = 8 bits.
Treating hexadecimal letters as case-sensitive
In hex, A and a are identical (both = 10). The case matters only for display consistency — mixing cases in a hash or colour code still produces the same value.
Be consistent with case in your codebase. Most conventions use lowercase for hashes, uppercase for colour codes.
Forgetting signed vs unsigned integers
In many languages, a number stored as a signed 8-bit integer has range -128 to 127. As unsigned: 0 to 255. Binary 11111111 = 255 (unsigned) or -1 (signed two's complement) — same bits, different interpretation.
Always specify signed/unsigned when working with binary representations.