Hex to Binary Converter
Save on GoogleTip: enter one number to see the digit-by-digit steps, decimal and octal. Several numbers (one per line), hex fractions like 2E.6 and prefixes like 0x1F also work.
Output appears here
Related Developer Tools | |
| Tool Name | Explanation |
|---|---|
| Binary to Hex Converter | Groups binary bits in fours and converts them into hex 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 D7 to Binary
| Hex digit | Binary (4 bits) | Part |
|---|---|---|
| D | 1101 | integer |
| 7 | 0111 | integer |
Join 1101 and 0111: 11010111.
Example 2: Convert 2E.6 to Binary
| Hex digit | Binary (4 bits) | Part |
|---|---|---|
| 2 | 0010 | integer |
| E | 1110 | integer |
| 6 | 0110 | fraction |
Join 0010 1110 . 0110 and drop the leading and trailing zeros: 101110.011.
Hex Digit to Binary Table (0-F)
| Hex digit | Binary (4-bit) | Decimal |
|---|---|---|
| 0 | 0000 | 0 |
| 1 | 0001 | 1 |
| 2 | 0010 | 2 |
| 3 | 0011 | 3 |
| 4 | 0100 | 4 |
| 5 | 0101 | 5 |
| 6 | 0110 | 6 |
| 7 | 0111 | 7 |
| 8 | 1000 | 8 |
| 9 | 1001 | 9 |
| A | 1010 | 10 |
| B | 1011 | 11 |
| C | 1100 | 12 |
| D | 1101 | 13 |
| E | 1110 | 14 |
| F | 1111 | 15 |
Hex to Binary Table (00-FF)
| Hex (2-digit) | Binary | Decimal | Octal |
|---|---|---|---|
| 00 | 0 | 0 | 0 |
| 01 | 1 | 1 | 1 |
| 02 | 10 | 2 | 2 |
| 03 | 11 | 3 | 3 |
| 04 | 100 | 4 | 4 |
| 05 | 101 | 5 | 5 |
| 06 | 110 | 6 | 6 |
| 07 | 111 | 7 | 7 |
| 08 | 1000 | 8 | 10 |
| 09 | 1001 | 9 | 11 |
| 0A | 1010 | 10 | 12 |
| 0B | 1011 | 11 | 13 |
| 0C | 1100 | 12 | 14 |
| 0D | 1101 | 13 | 15 |
| 0E | 1110 | 14 | 16 |
| 0F | 1111 | 15 | 17 |
| 10 | 10000 | 16 | 20 |
| 11 | 10001 | 17 | 21 |
| 12 | 10010 | 18 | 22 |
| 13 | 10011 | 19 | 23 |
| 14 | 10100 | 20 | 24 |
| 15 | 10101 | 21 | 25 |
| 16 | 10110 | 22 | 26 |
| 17 | 10111 | 23 | 27 |
| 18 | 11000 | 24 | 30 |
| 19 | 11001 | 25 | 31 |
| 1A | 11010 | 26 | 32 |
| 1B | 11011 | 27 | 33 |
| 1C | 11100 | 28 | 34 |
| 1D | 11101 | 29 | 35 |
| 1E | 11110 | 30 | 36 |
| 1F | 11111 | 31 | 37 |
| 20 | 100000 | 32 | 40 |
| 21 | 100001 | 33 | 41 |
| 22 | 100010 | 34 | 42 |
| 23 | 100011 | 35 | 43 |
| 24 | 100100 | 36 | 44 |
| 25 | 100101 | 37 | 45 |
| 26 | 100110 | 38 | 46 |
| 27 | 100111 | 39 | 47 |
| 28 | 101000 | 40 | 50 |
| 29 | 101001 | 41 | 51 |
| 2A | 101010 | 42 | 52 |
| 2B | 101011 | 43 | 53 |
| 2C | 101100 | 44 | 54 |
| 2D | 101101 | 45 | 55 |
| 2E | 101110 | 46 | 56 |
| 2F | 101111 | 47 | 57 |
| 30 | 110000 | 48 | 60 |
| 31 | 110001 | 49 | 61 |
| 32 | 110010 | 50 | 62 |
| 33 | 110011 | 51 | 63 |
| 34 | 110100 | 52 | 64 |
| 35 | 110101 | 53 | 65 |
| 36 | 110110 | 54 | 66 |
| 37 | 110111 | 55 | 67 |
| 38 | 111000 | 56 | 70 |
| 39 | 111001 | 57 | 71 |
| 3A | 111010 | 58 | 72 |
| 3B | 111011 | 59 | 73 |
| 3C | 111100 | 60 | 74 |
| 3D | 111101 | 61 | 75 |
| 3E | 111110 | 62 | 76 |
| 3F | 111111 | 63 | 77 |
| 40 | 1000000 | 64 | 100 |
| 41 | 1000001 | 65 | 101 |
| 42 | 1000010 | 66 | 102 |
| 43 | 1000011 | 67 | 103 |
| 44 | 1000100 | 68 | 104 |
| 45 | 1000101 | 69 | 105 |
| 46 | 1000110 | 70 | 106 |
| 47 | 1000111 | 71 | 107 |
| 48 | 1001000 | 72 | 110 |
| 49 | 1001001 | 73 | 111 |
| 4A | 1001010 | 74 | 112 |
| 4B | 1001011 | 75 | 113 |
| 4C | 1001100 | 76 | 114 |
| 4D | 1001101 | 77 | 115 |
| 4E | 1001110 | 78 | 116 |
| 4F | 1001111 | 79 | 117 |
| 50 | 1010000 | 80 | 120 |
| 51 | 1010001 | 81 | 121 |
| 52 | 1010010 | 82 | 122 |
| 53 | 1010011 | 83 | 123 |
| 54 | 1010100 | 84 | 124 |
| 55 | 1010101 | 85 | 125 |
| 56 | 1010110 | 86 | 126 |
| 57 | 1010111 | 87 | 127 |
| 58 | 1011000 | 88 | 130 |
| 59 | 1011001 | 89 | 131 |
| 5A | 1011010 | 90 | 132 |
| 5B | 1011011 | 91 | 133 |
| 5C | 1011100 | 92 | 134 |
| 5D | 1011101 | 93 | 135 |
| 5E | 1011110 | 94 | 136 |
| 5F | 1011111 | 95 | 137 |
| 60 | 1100000 | 96 | 140 |
| 61 | 1100001 | 97 | 141 |
| 62 | 1100010 | 98 | 142 |
| 63 | 1100011 | 99 | 143 |
| 64 | 1100100 | 100 | 144 |
| 65 | 1100101 | 101 | 145 |
| 66 | 1100110 | 102 | 146 |
| 67 | 1100111 | 103 | 147 |
| 68 | 1101000 | 104 | 150 |
| 69 | 1101001 | 105 | 151 |
| 6A | 1101010 | 106 | 152 |
| 6B | 1101011 | 107 | 153 |
| 6C | 1101100 | 108 | 154 |
| 6D | 1101101 | 109 | 155 |
| 6E | 1101110 | 110 | 156 |
| 6F | 1101111 | 111 | 157 |
| 70 | 1110000 | 112 | 160 |
| 71 | 1110001 | 113 | 161 |
| 72 | 1110010 | 114 | 162 |
| 73 | 1110011 | 115 | 163 |
| 74 | 1110100 | 116 | 164 |
| 75 | 1110101 | 117 | 165 |
| 76 | 1110110 | 118 | 166 |
| 77 | 1110111 | 119 | 167 |
| 78 | 1111000 | 120 | 170 |
| 79 | 1111001 | 121 | 171 |
| 7A | 1111010 | 122 | 172 |
| 7B | 1111011 | 123 | 173 |
| 7C | 1111100 | 124 | 174 |
| 7D | 1111101 | 125 | 175 |
| 7E | 1111110 | 126 | 176 |
| 7F | 1111111 | 127 | 177 |
| 80 | 10000000 | 128 | 200 |
| 81 | 10000001 | 129 | 201 |
| 82 | 10000010 | 130 | 202 |
| 83 | 10000011 | 131 | 203 |
| 84 | 10000100 | 132 | 204 |
| 85 | 10000101 | 133 | 205 |
| 86 | 10000110 | 134 | 206 |
| 87 | 10000111 | 135 | 207 |
| 88 | 10001000 | 136 | 210 |
| 89 | 10001001 | 137 | 211 |
| 8A | 10001010 | 138 | 212 |
| 8B | 10001011 | 139 | 213 |
| 8C | 10001100 | 140 | 214 |
| 8D | 10001101 | 141 | 215 |
| 8E | 10001110 | 142 | 216 |
| 8F | 10001111 | 143 | 217 |
| 90 | 10010000 | 144 | 220 |
| 91 | 10010001 | 145 | 221 |
| 92 | 10010010 | 146 | 222 |
| 93 | 10010011 | 147 | 223 |
| 94 | 10010100 | 148 | 224 |
| 95 | 10010101 | 149 | 225 |
| 96 | 10010110 | 150 | 226 |
| 97 | 10010111 | 151 | 227 |
| 98 | 10011000 | 152 | 230 |
| 99 | 10011001 | 153 | 231 |
| 9A | 10011010 | 154 | 232 |
| 9B | 10011011 | 155 | 233 |
| 9C | 10011100 | 156 | 234 |
| 9D | 10011101 | 157 | 235 |
| 9E | 10011110 | 158 | 236 |
| 9F | 10011111 | 159 | 237 |
| A0 | 10100000 | 160 | 240 |
| A1 | 10100001 | 161 | 241 |
| A2 | 10100010 | 162 | 242 |
| A3 | 10100011 | 163 | 243 |
| A4 | 10100100 | 164 | 244 |
| A5 | 10100101 | 165 | 245 |
| A6 | 10100110 | 166 | 246 |
| A7 | 10100111 | 167 | 247 |
| A8 | 10101000 | 168 | 250 |
| A9 | 10101001 | 169 | 251 |
| AA | 10101010 | 170 | 252 |
| AB | 10101011 | 171 | 253 |
| AC | 10101100 | 172 | 254 |
| AD | 10101101 | 173 | 255 |
| AE | 10101110 | 174 | 256 |
| AF | 10101111 | 175 | 257 |
| B0 | 10110000 | 176 | 260 |
| B1 | 10110001 | 177 | 261 |
| B2 | 10110010 | 178 | 262 |
| B3 | 10110011 | 179 | 263 |
| B4 | 10110100 | 180 | 264 |
| B5 | 10110101 | 181 | 265 |
| B6 | 10110110 | 182 | 266 |
| B7 | 10110111 | 183 | 267 |
| B8 | 10111000 | 184 | 270 |
| B9 | 10111001 | 185 | 271 |
| BA | 10111010 | 186 | 272 |
| BB | 10111011 | 187 | 273 |
| BC | 10111100 | 188 | 274 |
| BD | 10111101 | 189 | 275 |
| BE | 10111110 | 190 | 276 |
| BF | 10111111 | 191 | 277 |
| C0 | 11000000 | 192 | 300 |
| C1 | 11000001 | 193 | 301 |
| C2 | 11000010 | 194 | 302 |
| C3 | 11000011 | 195 | 303 |
| C4 | 11000100 | 196 | 304 |
| C5 | 11000101 | 197 | 305 |
| C6 | 11000110 | 198 | 306 |
| C7 | 11000111 | 199 | 307 |
| C8 | 11001000 | 200 | 310 |
| C9 | 11001001 | 201 | 311 |
| CA | 11001010 | 202 | 312 |
| CB | 11001011 | 203 | 313 |
| CC | 11001100 | 204 | 314 |
| CD | 11001101 | 205 | 315 |
| CE | 11001110 | 206 | 316 |
| CF | 11001111 | 207 | 317 |
| D0 | 11010000 | 208 | 320 |
| D1 | 11010001 | 209 | 321 |
| D2 | 11010010 | 210 | 322 |
| D3 | 11010011 | 211 | 323 |
| D4 | 11010100 | 212 | 324 |
| D5 | 11010101 | 213 | 325 |
| D6 | 11010110 | 214 | 326 |
| D7 | 11010111 | 215 | 327 |
| D8 | 11011000 | 216 | 330 |
| D9 | 11011001 | 217 | 331 |
| DA | 11011010 | 218 | 332 |
| DB | 11011011 | 219 | 333 |
| DC | 11011100 | 220 | 334 |
| DD | 11011101 | 221 | 335 |
| DE | 11011110 | 222 | 336 |
| DF | 11011111 | 223 | 337 |
| E0 | 11100000 | 224 | 340 |
| E1 | 11100001 | 225 | 341 |
| E2 | 11100010 | 226 | 342 |
| E3 | 11100011 | 227 | 343 |
| E4 | 11100100 | 228 | 344 |
| E5 | 11100101 | 229 | 345 |
| E6 | 11100110 | 230 | 346 |
| E7 | 11100111 | 231 | 347 |
| E8 | 11101000 | 232 | 350 |
| E9 | 11101001 | 233 | 351 |
| EA | 11101010 | 234 | 352 |
| EB | 11101011 | 235 | 353 |
| EC | 11101100 | 236 | 354 |
| ED | 11101101 | 237 | 355 |
| EE | 11101110 | 238 | 356 |
| EF | 11101111 | 239 | 357 |
| F0 | 11110000 | 240 | 360 |
| F1 | 11110001 | 241 | 361 |
| F2 | 11110010 | 242 | 362 |
| F3 | 11110011 | 243 | 363 |
| F4 | 11110100 | 244 | 364 |
| F5 | 11110101 | 245 | 365 |
| F6 | 11110110 | 246 | 366 |
| F7 | 11110111 | 247 | 367 |
| F8 | 11111000 | 248 | 370 |
| F9 | 11111001 | 249 | 371 |
| FA | 11111010 | 250 | 372 |
| FB | 11111011 | 251 | 373 |
| FC | 11111100 | 252 | 374 |
| FD | 11111101 | 253 | 375 |
| FE | 11111110 | 254 | 376 |
| FF | 11111111 | 255 | 377 |
Common Hex Numbers in Binary
| Number | Hex | Binary | Decimal |
|---|---|---|---|
| Subnet mask octet (/25) | 80 | 10000000 | 128 |
| Subnet mask octet (/26) | C0 | 11000000 | 192 |
| Subnet mask octet (/27) | E0 | 11100000 | 224 |
| Subnet mask octet (/28) | F0 | 11110000 | 240 |
| Subnet mask octet (/29) | F8 | 11111000 | 248 |
| Subnet mask octet (/30) | FC | 11111100 | 252 |
| Subnet mask octet (/31) | FE | 11111110 | 254 |
| Subnet mask octet (/24) | FF | 11111111 | 255 |
| SSH port | 16 | 10110 | 22 |
| SMTP port | 19 | 11001 | 25 |
| DNS port | 35 | 110101 | 53 |
| HTTP port | 50 | 1010000 | 80 |
| HTTPS port | 1BB | 110111011 | 443 |
| MySQL port | CEA | 110011101010 | 3306 |
| PostgreSQL port | 1538 | 1010100111000 | 5432 |
| Alternate HTTP port | 1F90 | 1111110010000 | 8080 |
| Loopback first octet | 7F | 1111111 | 127 |
| Private IP first octet (10.x.x.x) | A | 1010 | 10 |
| Private IP first octet (192.168.x.x) | C0 | 11000000 | 192 |
| Private IP second octet (192.168.x.x) | A8 | 10101000 | 168 |
| Ten | A | 1010 | 10 |
| One hundred | 64 | 1100100 | 100 |
| One thousand | 3E8 | 1111101000 | 1000 |
| Max signed 8-bit | 7F | 1111111 | 127 |
| Max unsigned 8-bit | FF | 11111111 | 255 |
| Values in a byte | 100 | 100000000 | 256 |
| One kibibyte | 400 | 10000000000 | 1024 |
| Page size | 1000 | 1000000000000 | 4096 |
| Max signed 16-bit | 7FFF | 111111111111111 | 32767 |
| Max unsigned 16-bit | FFFF | 1111111111111111 | 65535 |
| Values in 16 bits | 10000 | 10000000000000000 | 65536 |
| Max RGB hex FFFFFF | FFFFFF | 111111111111111111111111 | 16777215 |
| Max signed 32-bit | 7FFFFFFF | 1111111111111111111111111111111 | 2147483647 |
| Max unsigned 32-bit | FFFFFFFF | 11111111111111111111111111111111 | 4294967295 |
| Days from 1970 to 2000 | 2ACD | 10101011001101 | 10957 |
| ASCII letter A | 41 | 1000001 | 65 |
| ASCII letter a | 61 | 1100001 | 97 |
| ASCII digit 0 | 30 | 110000 | 48 |
| ASCII space | 20 | 100000 | 32 |
| ASCII line feed | A | 1010 | 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 |
Hex Fractions in Binary
| Hex | Binary |
|---|---|
| 0.8 | 0.1 |
| 0.4 | 0.01 |
| 0.2 | 0.001 |
| 0.1 | 0.0001 |
| 0.A | 0.101 |
| 0.C | 0.11 |
| 1.8 | 1.1 |
| 2.4 | 10.01 |
| F.F | 1111.1111 |
| 2E.6 | 101110.011 |
| A.A | 1010.101 |
| FF.FF | 11111111.11111111 |
| 0.0F | 0.00001111 |
| 0.19999 | 0.00011001100110011001 |
Technical Q&A / FAQ Matrix
| Technical Developer Question | Exact Solution & Code Snippet |
|---|---|
| How do I convert hex to binary in JavaScript? | parseInt('D7', 16).toString(2) |
| How do I convert hex to binary in Python? | format(int('D7', 16), 'b') |
| How do I convert hex to binary in Go? | n, _ := strconv.ParseInt("D7", 16, 64); fmt.Println(strconv.FormatInt(n, 2)) |
| How do I convert hex to binary in Java? | Integer.toBinaryString(Integer.parseInt("D7", 16)) |
| How do I convert hex to binary in C#? | Convert.ToString(Convert.ToInt32("D7", 16), 2) |
| How do I convert hex to binary in PHP? | echo decbin(hexdec('D7')); |
| How do I convert hex to binary in Rust? | format!("{:b}", i64::from_str_radix("D7", 16).unwrap()) |
| How do I convert hex to binary on Linux? | echo 'ibase=16; obase=2; D7' | bc |
| How do I convert hex to binary by hand? | Replace each hex digit with its 4-bit group. D = 1101 and 7 = 0111, so D7 is 11010111. |
| Why does each hex digit become exactly 4 bits? | Hex is base 16 and 16 = 2^4, so one hex digit holds 4 bits. Two hex digits make one byte. |
| What is the binary value of hex FF? | 11111111. Each F is 1111, so FF is 8 ones, which is 255 in decimal. |
| How do I convert a hex fraction to binary? | Convert each digit after the point to 4 bits. 0.A in hex is 0.1010 in binary, which is 0.101 after dropping trailing zeros. |
| How do I read a hex color in binary? | Each channel is one byte. #FF8000 is FF 80 00, which is 11111111 10000000 00000000. |
| Do leading zeros change the binary result? | The value stays the same. The tool drops leading zeros by default, or keeps full 4-bit groups when Leading zeros is set to Keep. |
| Why do I get an invalid character error? | Hex uses only 0-9 and A-F, in upper or lower case. Remove other letters and stray symbols. A 0x prefix, spaces and underscores are ignored. |
| How do I convert binary back to hex? | Group the bits in fours from the right. In JavaScript: parseInt('11010111', 2).toString(16) gives d7. |