How do I convert a number to binary or hexadecimal?
Converter for the four most common number bases: decimal (regular numbers), binary (zeros and ones), octal, and hexadecimal (HEX, with letters A-F).
Type a number in any field, the other three update instantly. Plus a bit visualization for binary values, you see which bits are turned on.
Useful for programmers (HEX colors, memory bytes), electronics (digital logic), and students learning computer science.
How to use it
- Type a number in any of the four fields: binary (2), octal (8), decimal (10), HEX (16).
- The other three fields update automatically.
- Below the fields you see the bit visualizer: a graphic of the binary number. Active bits (1) blue, inactive (0) gray, grouped by 4 for readability.
- Click the Copy icon next to any field to copy the value.
- HEX accepts letters A through F (lowercase or uppercase, no difference).
When this is useful
The most common uses:
- HEX colors in web design: "what is #FF5733 in RGB?". Convert each pair: FF=255, 57=87, 33=51 → RGB(255, 87, 51).
- Programming and debugging: "what is 10101010 in decimal?" → 170. "What number is 0x1F4?" → 500. The classic question when you're staring at a CPU register or memory dump.
- Electronics and microcontrollers: GPIO pin tables, register bit masks, memory addresses. You live in HEX and binary here.
- Linux file permissions: chmod 755 is octal. Each digit (rwx = read-write-execute) is 3 binary bits.
- Unicode character encoding: the "€" character is U+20AC. Convert 20AC from HEX to decimal (8364) to write it in HTML as `€`.
- Education, how computers "think": binary is the foundation of computer science. The bit visualizer shows that 8 = 1000 (one bit), 16 = 10000 (one bit further). Numbers are powers of two.