BIN.
Developer Tools — 2026

Binary Converter.

Convert between decimal, binary, hexadecimal, and octal. Text to binary, bitwise operations, and hex color breakdown — all in one free tool.

FreeNo Sign-upAll 4 BasesBitwise OpsColor Converter
2M+ Users
4.9★ Rating
4 Converter Modes

Loading Converter...

How to Use

01

Select Mode

All Bases converts between decimal, binary, hex, and octal simultaneously. Text ↔ Binary converts characters. Bitwise Ops performs AND/OR/XOR/NOT. Color Converter decodes hex colors to binary channels.

02

Enter a Value

In All Bases mode, type any number in any base field — all others update instantly. Binary accepts spaces between nibbles (e.g. 1010 1111). Hex accepts uppercase or lowercase letters.

03

Read Results

All four base representations appear simultaneously. The Bit Analysis panel shows a visual bit map, set bit count, and positional values. Copy any result with one click.

Conversion Method

Universal Positional Notation

Value = Σ (digit × base^position)

Position 0 is the rightmost digit. Increases left.

Base 2

Binary — digits 0, 1

Base 8

Octal — digits 0–7

Base 10

Decimal — digits 0–9

Base 16

Hex — digits 0–9, A–F

Worked Examples

Example 1: Decimal 175 → All Bases

Convert 175 (decimal) to binary, octal, and hexadecimal

  1. 01To binary: 175 ÷ 2 repeatedly → remainders: 1,1,1,1,0,1,0,1 → read bottom-up: 10101111
  2. 02To octal: 175 ÷ 8 = 21 R7, 21 ÷ 8 = 2 R5, 2 ÷ 8 = 0 R2 → 257
  3. 03To hex: 175 ÷ 16 = 10 R15(F), 10 ÷ 16 = 0 R10(A) → AF

175₁₀ = 10101111₂ = 257₈ = AF₁₆

Notice: AF in hex maps directly to binary 1010 1111 (A=1010, F=1111). Hex-to-binary needs no division.

Example 2: Bitwise AND on 0xAC and 0xF0

Masking operation — keep upper nibble of 0xAC

  1. 010xAC = 1010 1100, 0xF0 = 1111 0000
  2. 02AND bit by bit: 1010 1100 & 1111 0000
  3. 03Result: 1010 0000 = 0xA0 = 160

0xAC & 0xF0 = 0xA0 (160 decimal)

AND with 0xF0 (11110000) masks out the lower 4 bits — a classic bit masking pattern in networking and graphics.

Example 3: Hex color #1E90FF to RGB binary

Parse the web color DodgerBlue (#1E90FF)

  1. 01R = 0x1E = 30 = 00011110
  2. 02G = 0x90 = 144 = 10010000
  3. 03B = 0xFF = 255 = 11111111

R:00011110 G:10010000 B:11111111 → rgb(30, 144, 255)

Blue channel is fully saturated (11111111 = 255). Use Color Converter mode to see this breakdown visually.

Complete Guide

Binary, hexadecimal, octal, and decimal are all just different ways of writing the same numbers — they differ only in how many symbols (digits) each system uses. Understanding how to convert between them is a foundational skill in computer science, electrical engineering, cybersecurity, and web development. Our binary converter handles all four simultaneously, so you can see relationships between number systems at a glance.

Pro Tip: The fastest way to convert between binary and hex is to memorize the 16 nibble values: 0000=0, 0001=1, ..., 1000=8, 1001=9, 1010=A, 1011=B, 1100=C, 1101=D, 1110=E, 1111=F. With this, you can read binary numbers directly as hex without any calculation.

Why Four Number Systems?

Decimal (base-10) is the human number system — we use it because we have ten fingers. Every computer program's output is ultimately converted to decimal for human readability, but internally, computers never use decimal.

Binary (base-2) is the computer's native language. All digital hardware — transistors, logic gates, memory cells — operates in two states: on (1) and off (0). Every piece of data and every instruction in every computer program is ultimately stored and processed as binary.

Hexadecimal (base-16) is the programmer's shorthand for binary. Since one hex digit equals exactly 4 binary bits (a nibble), converting between hex and binary is trivial — just look up each digit independently. Hex is used everywhere in computing: memory addresses, color codes, byte values in network packets, ASCII/Unicode code points, SHA/MD5 hash outputs, and machine code listings.

Octal (base-8) was historically significant in early computing (PDP-8, Unix) and remains in use for Unix file permissions. chmod 755 in the terminal is octal: 7=111 (rwx), 5=101 (r-x), 5=101 (r-x) — the three groups of 3 bits map to read/write/execute permissions for owner, group, and others.

Bitwise Operations in Practice

Bitwise operations are among the most powerful tools in a low-level programmer's arsenal. They operate directly on the binary representation of integers, often replacing multiple arithmetic operations with a single efficient instruction.

Common patterns: AND masking — extract specific bits by ANDing with a mask (e.g. n & 0xFF keeps only the lowest byte). OR setting — set specific bits by ORing with a mask. XOR toggling — flip specific bits. Shift multiplicationn << 3 multiplies by 8 (2³) more efficiently than n * 8. These patterns appear constantly in graphics programming, network protocol parsing, encryption algorithms, and embedded systems.

Binary in Web Development

Web developers encounter binary regularly without always recognising it. Hex color codes in CSS are binary: #FF5733 is literally three bytes — 0xFF (red), 0x57 (green), 0x33 (blue). Each byte is 8 bits, and the combination of the three channels' 24 bits gives us 16,777,216 possible colors (2²⁴). Our Color Converter mode shows this breakdown visually, mapping each channel to its binary representation.

Base64 encoding (see our Base64 Encoder tool) takes 3 bytes (24 binary bits) and represents them as 4 ASCII characters by grouping bits into 6-bit chunks. Understanding binary makes Base64's structure immediately clear. Similarly, understanding hex makes reading browser DevTools memory dumps, HTTP headers, and cryptographic hashes straightforward.

Text to Binary and Back

Every text character has a numeric code point. ASCII maps the 128 basic English characters and control codes to 7-bit values (0-127). Unicode extends this to over 1.1 million code points for every script in the world. UTF-8 (the dominant web encoding) stores ASCII characters as single bytes and other characters as 2-4 bytes. Converting "Hello" to binary gives five 8-bit bytes: H=01001000, e=01100101, l=01101100, l=01101100, o=01101111. Our Text ↔ Binary mode handles full UTF-8 including Hindi scripts, emoji, and CJK characters.

More Developer Tools

Free utility and developer tools

Binary & Number Systems FAQ Hub

Everything you need to know about binary, hex, octal, and bitwise operations.

1. How do I convert decimal to binary?

Divide by 2 repeatedly, record remainders, read bottom-to-top. Example: 13 → 1101. Our All Bases mode shows all conversions simultaneously.

2. How do I convert binary to decimal?

Multiply each bit by 2 raised to its position, sum all. E.g. 1101 = 8+4+0+1 = 13.

3. How do I convert decimal to hexadecimal?

Divide by 16, record remainders (10-15 as A-F), read bottom-to-top. E.g. 255 = FF.

4. How do I convert hex to binary?

Each hex digit = 4 binary bits. A=1010, F=1111. AF = 1010 1111. One of the fastest conversions in number theory.

5. What is a nibble and a byte?

Nibble = 4 bits (1 hex digit). Byte = 8 bits (2 hex digits, 0-255). These are the fundamental units of digital data.

6. Difference between binary and hexadecimal?

Binary: base-2, only 0s and 1s. Hex: base-16, 0-9 and A-F. One hex digit = 4 binary bits. Hex is a compact shorthand for binary.

7. What are bitwise operations?

AND, OR, XOR, NOT, left/right shift — operations on individual bits. Fundamental in programming, digital logic, and cryptography.

8. What is bitwise AND?

Returns 1 only when both bits are 1. Uses: bit masking, checking even/odd (n & 1), clearing bits, extracting bit fields.

9. What is XOR used for?

Bits differ = 1, same = 0. Used for: simple encryption, swapping variables without temp, finding unique elements, checksums, bit toggling.

10. How do I convert text to binary?

Each character → Unicode code point → UTF-8 bytes → 8-bit binary per byte. "H" = 72 = 01001000.

11. What is the octal number system?

Base-8, digits 0-7. Each octal digit = 3 binary bits. Used in Unix file permissions (chmod 755).

12. What is 2's complement?

Standard way computers represent negative integers. To negate: flip all bits + add 1. E.g. +5=0101, flip=1010, +1=1011=-5.

13. What does 0x mean before a hex number?

0x is the programming prefix for hexadecimal (used in C, Java, JS, Python). 0b = binary, 0o = octal.

14. How are colors represented in hex?

#RRGGBB — each channel (0-255) as 2 hex digits. #FF5733 = Red:255, Green:87, Blue:51. Our Color Converter shows the full binary breakdown per channel.

15. What is left shift and right shift?

Left shift (<<): multiply by 2^N. Right shift (>>): divide by 2^N. Faster than multiplication in hardware.

16. Difference between 8-bit, 16-bit, 32-bit, 64-bit?

8-bit: 256 values. 16-bit: 65,536. 32-bit: ~4.3 billion. 64-bit: ~18.4 quintillion. Determines max int size and address space.

17. What is MSB and LSB?

MSB = leftmost bit (highest value). LSB = rightmost bit (always 2⁰=1). LSB determines odd (1) vs even (0).

18. How to check if a number is a power of 2?

If n & (n-1) == 0, it's a power of 2. Powers of 2 have exactly one bit set in binary (4=100, 8=1000).

19. What is binary used for in computing?

Every computation, file, pixel, and instruction reduces to binary. Hex is human-readable shorthand. Essential for CS, programming, and electronics.

20. How do I convert between any two bases?

Convert source → decimal → target base. Our All Bases mode does this instantly for all four bases simultaneously.

HQCalc — Developer Tools

Binary conversions use JavaScript BigInt for arbitrary precision. Color conversions use standard RGB/HSL formulas. © 2026 HQCalc.