FC

⚡ Number Base Converter

Binary - Octal - Decimal - Hex - instant conversion

Binary (Base 2)

0b11111111

Octal (Base 8)

0o377

Decimal (Base 10)

255

Hexadecimal (Base 16)

0xFF

Binary (grouped)

1111 1111

ASCII char (decimal 255)

-

Complete Guide

📊 Key Data Points

0x prefix for hex

Hexadecimal numbers in code use the 0x prefix: 0xFF = 255. Binary uses 0b: 0b1111 = 15

All bases simultaneous

Type in one base and all others update — no need to specify the conversion direction

Base 2-36

Covers standard bases (2, 8, 10, 16) and custom bases up to 36 (using A-Z for digits 10-35)

Number Base Converter — Binary Hex Decimal Octal -- Complete USA Guide 2026

Binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16) are the four number bases that every developer needs regularly — for hex color codes, binary flags, file permissions, and IP addresses. Converting between them manually is error-prone.

This converter shows all bases simultaneously as you type. Runs in your browser.

**Long-tail searches answered here:** number base converter online free, decimal to binary hex converter browser, binary octal hex decimal converter no install.

For bitwise operations, pair with Bitwise Calculator.

🔬 How This Calculator Works

Converts between decimal (base 10), binary (base 2), octal (base 8), hexadecimal (base 16), and any custom base (2-36). All bases update simultaneously as you type in any field. Supports negative numbers and fractional values. Shows the full working for the conversion (division/multiplication steps) as an educational reference.

✅ What You Can Calculate

All bases update simultaneously

Type in any base and all others update instantly. Enter hex FF and see decimal 255, binary 11111111, and octal 377 at the same time.

Custom base support

Convert to any base from 2 to 36. Base 32 (Crockford encoding), base 36 (URL-safe IDs), and other non-standard bases are all supported.

Conversion steps shown

Shows the division and multiplication steps for the conversion — useful for learning and verifying the arithmetic manually.

Fractional value support

Convert fractional numbers (3.14159...) between bases — not just integers.

🎯 Real Scenarios & Use Cases

CSS color debugging

CSS color #FF0000 is three 8-bit hex numbers: R=255, G=0, B=0. Convert each channel here to understand the decimal values.

chmod octal verification

File permissions use octal: chmod 755 means owner=7 (rwx), group=5 (r-x), others=5 (r-x). Verify the decimal equivalent here.

Network protocol bit fields

Network protocols use bit fields encoded as hex values. Convert to binary to see the individual flag bits.

Database ID encoding

Convert between decimal database IDs and hex encoded versions for URL-safe compact representations.

💡 Pro Tips for Accurate Results

Hex prefix 0x. Hexadecimal numbers in code use the 0x prefix: 0xFF = 255. Binary uses 0b: 0b1111 = 15. The converter accepts both prefixed and unprefixed input.

Bitwise operations in hex. Bitwise operations (AND, OR, XOR) are most readable in hex. Use Bitwise Calculator alongside this converter for bitmasking work.

Color codes are hex. CSS color #FF0000 is three 8-bit hex numbers: R=255, G=0, B=0. Convert each channel here.

chmod octal. File permissions use octal: chmod 755 means owner=7 (rwx), group=5 (r-x), others=5 (r-x). Use this with chmod Calculator.

🔗 Use These Together

🏁 Bottom Line

Base conversion is a constant need when working with hex color codes, binary protocols, file permissions, and IP addresses. This converter handles all common bases simultaneously. For bitwise operations: Bitwise Calculator.

When do developers actually need to convert between number bases?

Hex (base-16) appears constantly: colour codes (#3b82f6), memory addresses in debuggers (0x7fff5fbff8a8), byte values in network packets and binary file formats, Unix permissions bitmask representations, and character code points (U+1F600 is hex). Binary (base-2) is essential for understanding bitwise operations, CPU registers, networking (subnet masks as binary), and low-level data formats. Octal (base-8) appears in Unix chmod values (755 = 111 101 101 in binary) and some legacy systems. Developers working on embedded systems, networking, or security tools use all four bases regularly.

How do I read hex colour codes?

A hex colour like #3b82f6 is three bytes: RR GG BB. 3b = red channel (59 decimal = 23% intensity), 82 = green channel (130 decimal = 51%), f6 = blue channel (246 decimal = 96%). High blue and moderate green = a medium-blue colour. The shorthand #rgb doubles each digit: #38f = #3388ff. Alpha can be appended as a fourth byte: #3b82f680 — 80 hex = 128 decimal = 50% opacity. Understanding hex colours as three separate RGB bytes makes colour mixing intuitive: add to the blue byte to make it bluer, subtract from red and green to make it cooler.

How does bitwise AND, OR, XOR work and why do I need hex for it?

Bitwise operations work on individual bits of binary representations. AND (&): bit is 1 only if both inputs are 1 — used for masking: 0xFF & value keeps only the lowest byte. OR (|): bit is 1 if either input is 1 — used for setting flags: value | 0x04 sets bit 2. XOR (^): bit is 1 if inputs differ — used for toggling flags and simple encryption. NOT (~): flips all bits. Hex is used because each hex digit represents exactly 4 bits (a nibble), making the binary representation immediately readable: 0xFF = 1111 1111, 0x0F = 0000 1111. This is why bitwise code uses hex constants rather than decimal.

What is two's complement and how does it affect negative numbers?

Two's complement is how computers represent negative integers in binary. The most significant bit is the sign bit — 0 for positive, 1 for negative. To negate a number: flip all bits (one's complement) then add 1. -1 in 8-bit binary is 11111111 (0xFF in hex). -128 is 10000000 (0x80). This matters for: understanding overflow behaviour in fixed-width integers, reading raw memory dumps, and working with signed vs unsigned integer types. In C, (int8_t)0xFF = -1 but (uint8_t)0xFF = 255 — same bytes, different interpretation based on signedness.

How do I convert between hex and decimal in my head?

A useful mental shortcut: each hex digit is 4 bits and represents 0-15. For small hex values: 0xF = 15, 0xFF = 255, 0x100 = 256, 0x10 = 16, 0x1000 = 4096. For specific bytes: 0x80 = 128, 0x40 = 64, 0x20 = 32, 0x10 = 16. Powers of 16: 16^0 = 1, 16^1 = 16, 16^2 = 256, 16^3 = 4096, 16^4 = 65536. To convert 0x3b: 3×16 + 11 = 48 + 11 = 59. Most developers just use this calculator rather than doing mental hex arithmetic, but understanding the relationship helps with debugging.

Is my data sent to a server?

No — all conversion happens in your browser. Nothing is transmitted.

What other encoding and number tools are on this site?

The Binary to Text Converter handles text-as-binary encoding where each character becomes its ASCII bit pattern. The Bitwise Calculator performs AND, OR, XOR, NOT operations on hex or decimal values. The chmod Calculator uses octal values for Unix permissions. All are in the Dev Tools section.