Binary to Hex Converter
Save on GoogleTip: enter one number to see the 4-bit grouping steps, decimal and octal. Several numbers (one per line), binary fractions like 101110.011 and spaces inside a number (0010 1101) also work.
Output appears here
Related Developer Tools | |
| Tool Name | Explanation |
|---|---|
| Binary to Octal Converter | Groups binary bits in threes and converts them into octal digits. |
| Octal to Binary Converter | Expands each octal digit into 3 bits with steps, decimal and hex. |
| Text to Hex Converter | Converts text into hexadecimal bytes with separator and prefix options. |
| Hex to Text Converter | Decodes hexadecimal bytes back into readable text. |
| Binary to Decimal Converter | Converts binary numbers into decimal with bit-by-bit steps, hex and octal. |
| Decimal to Binary Converter | Converts decimal numbers into binary with steps, 2's complement and hex. |
| Octal to Text Converter | Decodes octal bytes (110 145 154 154 157) back into readable text. |
| Text to Octal Converter | Converts text into octal bytes with separator, digits and prefix options. |
| Binary to Text Converter | Decodes binary (0s and 1s) back into readable text. |
| Text to Binary Converter | Converts text into 8-bit or 7-bit binary (0s and 1s) instantly. |
| Base64 Encode / Decode | Encodes text or files to Base64 and decodes Base64 strings instantly. |
| JSON to Go Struct Converter | Generates idiomatic Go structs with json tags from any JSON payload. |
| JSON to TypeScript Interface | Generates typed TypeScript interfaces from any JSON payload. |
| HTML to JSX Converter | Converts HTML markup into valid React JSX (className, self-closing tags, style objects). |
| TOML to JSON Converter | Transforms TOML config files into clean, formatted JSON or YAML. |
Example 1: Convert 11010111 to Hex
| Binary group (4 bits) | Hex digit | Part |
|---|---|---|
| 1101 | D | integer |
| 0111 | 7 | integer |
Split into 1101 and 0111, then join the digits: D7.
Example 2: Convert 101110.011 to Hex
| Binary group (4 bits) | Hex digit | Part |
|---|---|---|
| 0010 | 2 | integer |
| 1110 | E | integer |
| 0110 | 6 | fraction |
Pad to 0010 1110 . 0110 and join the digits: 2E.6.
Binary to Hex Table (4-bit, 0-F)
| Binary (4-bit) | Hex | Decimal |
|---|---|---|
0000 | 0 | 0 |
0001 | 1 | 1 |
0010 | 2 | 2 |
0011 | 3 | 3 |
0100 | 4 | 4 |
0101 | 5 | 5 |
0110 | 6 | 6 |
0111 | 7 | 7 |
1000 | 8 | 8 |
1001 | 9 | 9 |
1010 | A | 10 |
1011 | B | 11 |
1100 | C | 12 |
1101 | D | 13 |
1110 | E | 14 |
1111 | F | 15 |
Binary to Hex Table (8-bit, 0-255)
| Binary (8-bit) | Hex | Decimal | Octal |
|---|---|---|---|
00000000 | 00 | 0 | 0 |
00000001 | 01 | 1 | 1 |
00000010 | 02 | 2 | 2 |
00000011 | 03 | 3 | 3 |
00000100 | 04 | 4 | 4 |
00000101 | 05 | 5 | 5 |
00000110 | 06 | 6 | 6 |
00000111 | 07 | 7 | 7 |
00001000 | 08 | 8 | 10 |
00001001 | 09 | 9 | 11 |
00001010 | 0A | 10 | 12 |
00001011 | 0B | 11 | 13 |
00001100 | 0C | 12 | 14 |
00001101 | 0D | 13 | 15 |
00001110 | 0E | 14 | 16 |
00001111 | 0F | 15 | 17 |
00010000 | 10 | 16 | 20 |
00010001 | 11 | 17 | 21 |
00010010 | 12 | 18 | 22 |
00010011 | 13 | 19 | 23 |
00010100 | 14 | 20 | 24 |
00010101 | 15 | 21 | 25 |
00010110 | 16 | 22 | 26 |
00010111 | 17 | 23 | 27 |
00011000 | 18 | 24 | 30 |
00011001 | 19 | 25 | 31 |
00011010 | 1A | 26 | 32 |
00011011 | 1B | 27 | 33 |
00011100 | 1C | 28 | 34 |
00011101 | 1D | 29 | 35 |
00011110 | 1E | 30 | 36 |
00011111 | 1F | 31 | 37 |
00100000 | 20 | 32 | 40 |
00100001 | 21 | 33 | 41 |
00100010 | 22 | 34 | 42 |
00100011 | 23 | 35 | 43 |
00100100 | 24 | 36 | 44 |
00100101 | 25 | 37 | 45 |
00100110 | 26 | 38 | 46 |
00100111 | 27 | 39 | 47 |
00101000 | 28 | 40 | 50 |
00101001 | 29 | 41 | 51 |
00101010 | 2A | 42 | 52 |
00101011 | 2B | 43 | 53 |
00101100 | 2C | 44 | 54 |
00101101 | 2D | 45 | 55 |
00101110 | 2E | 46 | 56 |
00101111 | 2F | 47 | 57 |
00110000 | 30 | 48 | 60 |
00110001 | 31 | 49 | 61 |
00110010 | 32 | 50 | 62 |
00110011 | 33 | 51 | 63 |
00110100 | 34 | 52 | 64 |
00110101 | 35 | 53 | 65 |
00110110 | 36 | 54 | 66 |
00110111 | 37 | 55 | 67 |
00111000 | 38 | 56 | 70 |
00111001 | 39 | 57 | 71 |
00111010 | 3A | 58 | 72 |
00111011 | 3B | 59 | 73 |
00111100 | 3C | 60 | 74 |
00111101 | 3D | 61 | 75 |
00111110 | 3E | 62 | 76 |
00111111 | 3F | 63 | 77 |
01000000 | 40 | 64 | 100 |
01000001 | 41 | 65 | 101 |
01000010 | 42 | 66 | 102 |
01000011 | 43 | 67 | 103 |
01000100 | 44 | 68 | 104 |
01000101 | 45 | 69 | 105 |
01000110 | 46 | 70 | 106 |
01000111 | 47 | 71 | 107 |
01001000 | 48 | 72 | 110 |
01001001 | 49 | 73 | 111 |
01001010 | 4A | 74 | 112 |
01001011 | 4B | 75 | 113 |
01001100 | 4C | 76 | 114 |
01001101 | 4D | 77 | 115 |
01001110 | 4E | 78 | 116 |
01001111 | 4F | 79 | 117 |
01010000 | 50 | 80 | 120 |
01010001 | 51 | 81 | 121 |
01010010 | 52 | 82 | 122 |
01010011 | 53 | 83 | 123 |
01010100 | 54 | 84 | 124 |
01010101 | 55 | 85 | 125 |
01010110 | 56 | 86 | 126 |
01010111 | 57 | 87 | 127 |
01011000 | 58 | 88 | 130 |
01011001 | 59 | 89 | 131 |
01011010 | 5A | 90 | 132 |
01011011 | 5B | 91 | 133 |
01011100 | 5C | 92 | 134 |
01011101 | 5D | 93 | 135 |
01011110 | 5E | 94 | 136 |
01011111 | 5F | 95 | 137 |
01100000 | 60 | 96 | 140 |
01100001 | 61 | 97 | 141 |
01100010 | 62 | 98 | 142 |
01100011 | 63 | 99 | 143 |
01100100 | 64 | 100 | 144 |
01100101 | 65 | 101 | 145 |
01100110 | 66 | 102 | 146 |
01100111 | 67 | 103 | 147 |
01101000 | 68 | 104 | 150 |
01101001 | 69 | 105 | 151 |
01101010 | 6A | 106 | 152 |
01101011 | 6B | 107 | 153 |
01101100 | 6C | 108 | 154 |
01101101 | 6D | 109 | 155 |
01101110 | 6E | 110 | 156 |
01101111 | 6F | 111 | 157 |
01110000 | 70 | 112 | 160 |
01110001 | 71 | 113 | 161 |
01110010 | 72 | 114 | 162 |
01110011 | 73 | 115 | 163 |
01110100 | 74 | 116 | 164 |
01110101 | 75 | 117 | 165 |
01110110 | 76 | 118 | 166 |
01110111 | 77 | 119 | 167 |
01111000 | 78 | 120 | 170 |
01111001 | 79 | 121 | 171 |
01111010 | 7A | 122 | 172 |
01111011 | 7B | 123 | 173 |
01111100 | 7C | 124 | 174 |
01111101 | 7D | 125 | 175 |
01111110 | 7E | 126 | 176 |
01111111 | 7F | 127 | 177 |
10000000 | 80 | 128 | 200 |
10000001 | 81 | 129 | 201 |
10000010 | 82 | 130 | 202 |
10000011 | 83 | 131 | 203 |
10000100 | 84 | 132 | 204 |
10000101 | 85 | 133 | 205 |
10000110 | 86 | 134 | 206 |
10000111 | 87 | 135 | 207 |
10001000 | 88 | 136 | 210 |
10001001 | 89 | 137 | 211 |
10001010 | 8A | 138 | 212 |
10001011 | 8B | 139 | 213 |
10001100 | 8C | 140 | 214 |
10001101 | 8D | 141 | 215 |
10001110 | 8E | 142 | 216 |
10001111 | 8F | 143 | 217 |
10010000 | 90 | 144 | 220 |
10010001 | 91 | 145 | 221 |
10010010 | 92 | 146 | 222 |
10010011 | 93 | 147 | 223 |
10010100 | 94 | 148 | 224 |
10010101 | 95 | 149 | 225 |
10010110 | 96 | 150 | 226 |
10010111 | 97 | 151 | 227 |
10011000 | 98 | 152 | 230 |
10011001 | 99 | 153 | 231 |
10011010 | 9A | 154 | 232 |
10011011 | 9B | 155 | 233 |
10011100 | 9C | 156 | 234 |
10011101 | 9D | 157 | 235 |
10011110 | 9E | 158 | 236 |
10011111 | 9F | 159 | 237 |
10100000 | A0 | 160 | 240 |
10100001 | A1 | 161 | 241 |
10100010 | A2 | 162 | 242 |
10100011 | A3 | 163 | 243 |
10100100 | A4 | 164 | 244 |
10100101 | A5 | 165 | 245 |
10100110 | A6 | 166 | 246 |
10100111 | A7 | 167 | 247 |
10101000 | A8 | 168 | 250 |
10101001 | A9 | 169 | 251 |
10101010 | AA | 170 | 252 |
10101011 | AB | 171 | 253 |
10101100 | AC | 172 | 254 |
10101101 | AD | 173 | 255 |
10101110 | AE | 174 | 256 |
10101111 | AF | 175 | 257 |
10110000 | B0 | 176 | 260 |
10110001 | B1 | 177 | 261 |
10110010 | B2 | 178 | 262 |
10110011 | B3 | 179 | 263 |
10110100 | B4 | 180 | 264 |
10110101 | B5 | 181 | 265 |
10110110 | B6 | 182 | 266 |
10110111 | B7 | 183 | 267 |
10111000 | B8 | 184 | 270 |
10111001 | B9 | 185 | 271 |
10111010 | BA | 186 | 272 |
10111011 | BB | 187 | 273 |
10111100 | BC | 188 | 274 |
10111101 | BD | 189 | 275 |
10111110 | BE | 190 | 276 |
10111111 | BF | 191 | 277 |
11000000 | C0 | 192 | 300 |
11000001 | C1 | 193 | 301 |
11000010 | C2 | 194 | 302 |
11000011 | C3 | 195 | 303 |
11000100 | C4 | 196 | 304 |
11000101 | C5 | 197 | 305 |
11000110 | C6 | 198 | 306 |
11000111 | C7 | 199 | 307 |
11001000 | C8 | 200 | 310 |
11001001 | C9 | 201 | 311 |
11001010 | CA | 202 | 312 |
11001011 | CB | 203 | 313 |
11001100 | CC | 204 | 314 |
11001101 | CD | 205 | 315 |
11001110 | CE | 206 | 316 |
11001111 | CF | 207 | 317 |
11010000 | D0 | 208 | 320 |
11010001 | D1 | 209 | 321 |
11010010 | D2 | 210 | 322 |
11010011 | D3 | 211 | 323 |
11010100 | D4 | 212 | 324 |
11010101 | D5 | 213 | 325 |
11010110 | D6 | 214 | 326 |
11010111 | D7 | 215 | 327 |
11011000 | D8 | 216 | 330 |
11011001 | D9 | 217 | 331 |
11011010 | DA | 218 | 332 |
11011011 | DB | 219 | 333 |
11011100 | DC | 220 | 334 |
11011101 | DD | 221 | 335 |
11011110 | DE | 222 | 336 |
11011111 | DF | 223 | 337 |
11100000 | E0 | 224 | 340 |
11100001 | E1 | 225 | 341 |
11100010 | E2 | 226 | 342 |
11100011 | E3 | 227 | 343 |
11100100 | E4 | 228 | 344 |
11100101 | E5 | 229 | 345 |
11100110 | E6 | 230 | 346 |
11100111 | E7 | 231 | 347 |
11101000 | E8 | 232 | 350 |
11101001 | E9 | 233 | 351 |
11101010 | EA | 234 | 352 |
11101011 | EB | 235 | 353 |
11101100 | EC | 236 | 354 |
11101101 | ED | 237 | 355 |
11101110 | EE | 238 | 356 |
11101111 | EF | 239 | 357 |
11110000 | F0 | 240 | 360 |
11110001 | F1 | 241 | 361 |
11110010 | F2 | 242 | 362 |
11110011 | F3 | 243 | 363 |
11110100 | F4 | 244 | 364 |
11110101 | F5 | 245 | 365 |
11110110 | F6 | 246 | 366 |
11110111 | F7 | 247 | 367 |
11111000 | F8 | 248 | 370 |
11111001 | F9 | 249 | 371 |
11111010 | FA | 250 | 372 |
11111011 | FB | 251 | 373 |
11111100 | FC | 252 | 374 |
11111101 | FD | 253 | 375 |
11111110 | FE | 254 | 376 |
11111111 | FF | 255 | 377 |
Common Binary Numbers in Hex
| Number | Binary | Hex | Decimal |
|---|---|---|---|
| Subnet mask octet (/25) | 10000000 | 80 | 128 |
| Subnet mask octet (/26) | 11000000 | C0 | 192 |
| Subnet mask octet (/27) | 11100000 | E0 | 224 |
| Subnet mask octet (/28) | 11110000 | F0 | 240 |
| Subnet mask octet (/29) | 11111000 | F8 | 248 |
| Subnet mask octet (/30) | 11111100 | FC | 252 |
| Subnet mask octet (/31) | 11111110 | FE | 254 |
| Subnet mask octet (/24) | 11111111 | FF | 255 |
| SSH port | 10110 | 16 | 22 |
| SMTP port | 11001 | 19 | 25 |
| DNS port | 110101 | 35 | 53 |
| HTTP port | 1010000 | 50 | 80 |
| HTTPS port | 110111011 | 1BB | 443 |
| MySQL port | 110011101010 | CEA | 3306 |
| PostgreSQL port | 1010100111000 | 1538 | 5432 |
| Alternate HTTP port | 1111110010000 | 1F90 | 8080 |
| Loopback first octet | 1111111 | 7F | 127 |
| Private IP first octet (10.x.x.x) | 1010 | A | 10 |
| Private IP first octet (192.168.x.x) | 11000000 | C0 | 192 |
| Private IP second octet (192.168.x.x) | 10101000 | A8 | 168 |
| Ten | 1010 | A | 10 |
| One hundred | 1100100 | 64 | 100 |
| One thousand | 1111101000 | 3E8 | 1000 |
| Max signed 8-bit | 1111111 | 7F | 127 |
| Max unsigned 8-bit | 11111111 | FF | 255 |
| Values in a byte | 100000000 | 100 | 256 |
| One kibibyte | 10000000000 | 400 | 1024 |
| Page size | 1000000000000 | 1000 | 4096 |
| Max signed 16-bit | 111111111111111 | 7FFF | 32767 |
| Max unsigned 16-bit | 1111111111111111 | FFFF | 65535 |
| Values in 16 bits | 10000000000000000 | 10000 | 65536 |
| Max RGB hex FFFFFF | 111111111111111111111111 | FFFFFF | 16777215 |
| Max signed 32-bit | 1111111111111111111111111111111 | 7FFFFFFF | 2147483647 |
| Max unsigned 32-bit | 11111111111111111111111111111111 | FFFFFFFF | 4294967295 |
| Days from 1970 to 2000 | 10101011001101 | 2ACD | 10957 |
| ASCII letter A | 1000001 | 41 | 65 |
| ASCII letter a | 1100001 | 61 | 97 |
| ASCII digit 0 | 110000 | 30 | 48 |
| ASCII space | 100000 | 20 | 32 |
| ASCII line feed | 1010 | A | 10 |
Common Hex Colors in Binary
| Color | Hex | Binary (R G B) |
|---|---|---|
| Black | #000000 | 00000000 00000000 00000000 |
| White | #FFFFFF | 11111111 11111111 11111111 |
| Red | #FF0000 | 11111111 00000000 00000000 |
| Green (lime) | #00FF00 | 00000000 11111111 00000000 |
| Blue | #0000FF | 00000000 00000000 11111111 |
| Yellow | #FFFF00 | 11111111 11111111 00000000 |
| Cyan | #00FFFF | 00000000 11111111 11111111 |
| Magenta | #FF00FF | 11111111 00000000 11111111 |
| Gray | #808080 | 10000000 10000000 10000000 |
| Silver | #C0C0C0 | 11000000 11000000 11000000 |
| Orange | #FFA500 | 11111111 10100101 00000000 |
| Navy | #000080 | 00000000 00000000 10000000 |
| Teal | #008080 | 00000000 10000000 10000000 |
| Maroon | #800000 | 10000000 00000000 00000000 |
| Olive | #808000 | 10000000 10000000 00000000 |
| Purple | #800080 | 10000000 00000000 10000000 |
Binary Fractions in Hex
| Binary | Hex |
|---|---|
0.1 | 0.8 |
0.01 | 0.4 |
0.001 | 0.2 |
0.0001 | 0.1 |
0.101 | 0.A |
0.1111 | 0.F |
1.1 | 1.8 |
10.01 | 2.4 |
101.011 | 5.6 |
1000.0001 | 8.1 |
1101.101 | D.A |
101110.011 | 2E.6 |
11.001001 | 3.24 |
0.0001100110011001 | 0.1999 |
Technical Q&A / FAQ Matrix
| Technical Developer Question | Exact Solution & Code Snippet |
|---|---|
| How do I convert binary to hex in JavaScript? | parseInt('11010111', 2).toString(16).toUpperCase() |
| How do I convert binary to hex in Python? | format(int('11010111', 2), 'X') |
| How do I convert binary to hex in Go? | n, _ := strconv.ParseInt("11010111", 2, 64); fmt.Println(strconv.FormatInt(n, 16)) |
| How do I convert binary to hex in Java? | Integer.toHexString(Integer.parseInt("11010111", 2)) |
| How do I convert binary to hex in C#? | Convert.ToString(Convert.ToInt32("11010111", 2), 16) |
| How do I convert binary to hex in PHP? | echo dechex(bindec('11010111')); |
| How do I convert binary to hex in Rust? | format!("{:X}", i64::from_str_radix("11010111", 2).unwrap()) |
| How do I convert binary to hex on Linux? | echo 'ibase=2; obase=10000; 11010111' | bc |
| How do I convert binary to hex by hand? | Split the bits into groups of 4 starting from the right, padding the left with zeros. Replace each group with its hex digit. 11010111 becomes 1101 0111 = D7. |
| Why do 4 bits make one hex digit? | Hex is base 16 and 16 = 2^4, so each hex digit holds exactly 4 bits. Two hex digits make one byte. |
| How do I group a binary fraction? | Start at the point and group to the right, padding the end with zeros. 0.101 becomes 0.1010, which is 0.A in hex. |
| What is the hex value of 11111111? | FF. The groups are 1111 and 1111, so F and F. That is 255 in decimal. |
| How do I read a hex color in binary? | Each channel is one byte. #FF8000 is 11111111 10000000 00000000: red 255, green 128, blue 0. |
| Do leading zeros change the hex result? | No. 00001010 and 1010 both give A. The tool pads groups of 4 bits for you. |
| Why do I get an invalid character error? | Binary uses only 0 and 1. Remove digits such as 2 to 9, letters and stray symbols. Spaces and underscores inside a number are ignored. |
| How do I convert hex back to binary? | Replace each hex digit with its 4-bit group. In JavaScript: parseInt('D7', 16).toString(2) gives 11010111. |