Developer Toolkit

Number Base
Converter

Instantly convert any number between binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16). Type in any field — all others update live. Includes a bit visualiser, ASCII/Unicode lookup, hex color picker, and bitwise operations.

Base 10 Decimal
Base 2 Binary
Base 16 Hexadecimal
Base 8 Octal
Signed (Two's complement)
8-bit range
Bit length
bits needed
IEEE 754 (32-bit float)
sign · exponent · mantissa
ASCII / Unicode Character Lookup
Character
Decimal
Binary
Hex
Octal
HTML entity
Hex Color Picker Enter a 6-digit hex value above to see it as a color
Hex
#FFFFFF
RGB
rgb(255, 255, 255)
Decimal (R·G·B)
255 · 255 · 255
Binary (R)
11111111
Bitwise Operations
📖 How to Use the Number Base Converter
1
Type in any field
Click any of the four base fields and start typing — all other fields update instantly. Type a decimal number in the Decimal field, a binary string in Binary, a hex value in Hex, or an octal number in Octal. Invalid characters for the selected base are simply ignored (e.g. typing 2 in a binary field has no effect). There's no convert button to press.
2
Read the bit visualiser
Below the Binary field, each bit of the current number is shown as a green tile (1) or grey tile (0). Bits are grouped in nibbles (groups of 4) to match how programmers read binary. This makes it easy to see the pattern of set and unset bits at a glance — useful for understanding bit flags, masks, and bitwise operations.
3
Use the ASCII lookup
Type a character (like A, @, or ) in the Character field to see its decimal code, binary representation, hex code, octal, and HTML entity. Or type a decimal code (like 65) in the Decimal code field to find the character it represents. Works for standard ASCII (0–127) and extended Unicode characters.
4
Hex color picker
Type a 6-digit hex value in the Hex field (like FF5733) to see it rendered as a color swatch — showing its RGB breakdown and binary representation of the red channel. Click the swatch itself to open a color picker and choose any color to get its hex, decimal, and binary values. Click preset swatches on the right for common colors.
5
Bitwise operations
Enter two decimal values in the Bitwise Operations panel to see the results of AND, OR, XOR, NOT A, left shift, and right shift operations — all shown in both decimal and binary. This is useful for understanding bit masking, flag operations, and low-level programming without having to write code. Results update as you type.
6
Copy any result
Each base field has a copy button in the top-right corner. Click it to copy that base's current value to your clipboard — useful when you're working in code and need to paste a hex literal (0xFF), a binary constant (0b11111111), or a decimal value into your editor. The button flashes green to confirm the copy.
Quick base shortcuts: In most programming languages, prefix numbers to specify base — 0b for binary (e.g. 0b1010), 0x for hexadecimal (e.g. 0xFF), 0o for octal (e.g. 0o17). No prefix means decimal. CSS hex colors use a # prefix (#FF5733). SQL and some other languages use 0x for hex only.
Quick Reference Table (0–16)
DecBinaryHexOctDecBinaryHexOct

Why do computers use binary?

Computers are built from transistors — microscopic switches that are either on (1) or off (0). Binary maps perfectly to this physical reality: every bit of data stored in memory, transmitted over a network, or processed by a CPU is ultimately a sequence of on/off states. Using base 2 means the entire logic of computing can be implemented with just two states, making circuits simpler, faster, and more reliable. All other number systems (decimal, hex, octal) are just human-readable representations of the same underlying binary data.

Why do programmers use hexadecimal?

Hexadecimal (base 16) is a shorthand for binary — each hex digit represents exactly 4 binary bits (a nibble). So an 8-bit byte (like 11111111) is just two hex digits (FF). This makes hex far more compact and readable than raw binary for things like memory addresses, color values, error codes, and bytecodes. A 32-bit memory address takes 8 hex digits vs 32 binary digits. Most debugging tools, hex editors, and developer consoles display values in hex for this reason.

What is octal used for?

Octal (base 8) was more common in early computing when machines used 6-bit and 12-bit word sizes (both divisible by 3, making octal a natural fit). Today its main use is Unix/Linux file permissions — the permission flags rwxrwxrwx map to 3-bit groups, making octal the natural way to express them. chmod 755 means owner=7 (rwx=111₂), group=5 (r-x=101₂), others=5. You'll also see octal in some network protocols and escape sequences — \077 in C is the octal escape for ?.

What are bitwise operations used for?

Bitwise operations work directly on the binary representation of numbers and are used throughout systems programming, embedded development, and performance-critical code. AND is used for bit masking (isolating specific bits). OR sets specific bits. XOR flips bits or checks for differences (used in encryption and checksums). NOT inverts all bits. Left shift (≪) is a fast way to multiply by powers of 2. Right shift (≫) divides by powers of 2. Game engines, graphics pipelines, compression algorithms, and cryptography all rely heavily on bitwise operations.

Frequently Asked Questions
How do I convert binary to decimal?
To convert binary to decimal manually: write the binary number, then multiply each digit by 2 raised to its position (counting right to left from 0). Add all the results. For example, 1011 in binary: (1×2³) + (0×2²) + (1×2¹) + (1×2⁰) = 8 + 0 + 2 + 1 = 11 in decimal. Or just type the binary number into the Binary field above and read the decimal result instantly. The bit visualiser below the binary field shows each bit's position, making the process easy to follow.
How do I convert decimal to hexadecimal?
To convert decimal to hex manually: repeatedly divide the number by 16 and record the remainders. Remainders 0–9 stay as digits; remainders 10–15 become A–F. Read the remainders bottom to top. For example, 255 ÷ 16 = 15 remainder 15 (F), and 15 ÷ 16 = 0 remainder 15 (F) → FF. Or type 255 into the Decimal field above and read the hex value instantly. The reference table below shows all conversions for 0–16 side by side.
What does 0xFF mean in programming?
0xFF is a hexadecimal literal meaning 255 in decimal, or 11111111 in binary. The 0x prefix tells the programming language to interpret the following digits as hexadecimal. 0xFF is commonly used as a byte mask — ANDing any value with 0xFF extracts the lowest 8 bits. It also appears in RGB colors (where #FFFFFF = white = R:255, G:255, B:255), memory addresses, and byte-level data manipulation. In CSS, hex color codes use # instead of 0x.
What are two's complement and signed integers?
Two's complement is the standard way computers represent negative integers in binary. In an 8-bit signed integer, the most significant bit (leftmost) is the sign bit: 0 = positive, 1 = negative. Positive numbers (0–127) are stored normally. Negative numbers are stored by inverting all bits and adding 1 — so −1 becomes 11111111 (255 unsigned). This is why a signed 8-bit integer ranges from −128 to +127. The "Signed" value shown in this converter uses 32-bit two's complement, matching how most programming languages represent integers.
How to Use the Number Base Converter

Convert between binary, decimal, hexadecimal, and octal instantly with visual bit breakdown.

01
Type in any base field
Enter a number in binary, decimal, hex, or octal — all other fields update simultaneously in real time.
02
Use the bit visualiser
Below the fields, each bit of the binary representation is shown as an individual toggle. This makes binary counting intuitive rather than abstract.
03
Look up ASCII/Unicode
Switch to the ASCII tab to find character codes. Type a character to see its decimal, hex, and binary values — or enter a code to see the character.
04
Try the hex colour picker
Hex colours are just RGB values in base 16. Enter a hex colour code to see the red, green, and blue channels in decimal.
05
Use the bitwise operations panel
AND, OR, XOR, and NOT operations on two numbers — results shown in all bases simultaneously. Useful for binary masking, flags, and low-level programming.
💡
💡 Hexadecimal is base 16: 0–9 then A–F. One hex digit represents exactly 4 binary bits (a 'nibble'). Two hex digits represent one byte (8 bits). This is why colours use 6 hex digits: 2 each for R, G, B.