T
THINKFORU
Submit Feedback

Binary to Hex Converter

Binary to Hex Converter

Save on Google
Tip: 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 NameExplanation
Binary to Octal ConverterGroups binary bits in threes and converts them into octal digits.
Octal to Binary ConverterExpands each octal digit into 3 bits with steps, decimal and hex.
Text to Hex ConverterConverts text into hexadecimal bytes with separator and prefix options.
Hex to Text ConverterDecodes hexadecimal bytes back into readable text.
Binary to Decimal ConverterConverts binary numbers into decimal with bit-by-bit steps, hex and octal.
Decimal to Binary ConverterConverts decimal numbers into binary with steps, 2's complement and hex.
Octal to Text ConverterDecodes octal bytes (110 145 154 154 157) back into readable text.
Text to Octal ConverterConverts text into octal bytes with separator, digits and prefix options.
Binary to Text ConverterDecodes binary (0s and 1s) back into readable text.
Text to Binary ConverterConverts text into 8-bit or 7-bit binary (0s and 1s) instantly.
Base64 Encode / DecodeEncodes text or files to Base64 and decodes Base64 strings instantly.
JSON to Go Struct ConverterGenerates idiomatic Go structs with json tags from any JSON payload.
JSON to TypeScript InterfaceGenerates typed TypeScript interfaces from any JSON payload.
HTML to JSX ConverterConverts HTML markup into valid React JSX (className, self-closing tags, style objects).
TOML to JSON ConverterTransforms TOML config files into clean, formatted JSON or YAML.

Example 1: Convert 11010111 to Hex

Binary group (4 bits)Hex digitPart
1101Dinteger
01117integer
Split into 1101 and 0111, then join the digits: D7.

Example 2: Convert 101110.011 to Hex

Binary group (4 bits)Hex digitPart
00102integer
1110Einteger
01106fraction
Pad to 0010 1110 . 0110 and join the digits: 2E.6.

Binary to Hex Table (4-bit, 0-F)

Binary (4-bit)HexDecimal
000000
000111
001022
001133
010044
010155
011066
011177
100088
100199
1010A10
1011B11
1100C12
1101D13
1110E14
1111F15

Binary to Hex Table (8-bit, 0-255)

Binary (8-bit)HexDecimalOctal
000000000000
000000010111
000000100222
000000110333
000001000444
000001010555
000001100666
000001110777
0000100008810
0000100109911
000010100A1012
000010110B1113
000011000C1214
000011010D1315
000011100E1416
000011110F1517
00010000101620
00010001111721
00010010121822
00010011131923
00010100142024
00010101152125
00010110162226
00010111172327
00011000182430
00011001192531
000110101A2632
000110111B2733
000111001C2834
000111011D2935
000111101E3036
000111111F3137
00100000203240
00100001213341
00100010223442
00100011233543
00100100243644
00100101253745
00100110263846
00100111273947
00101000284050
00101001294151
001010102A4252
001010112B4353
001011002C4454
001011012D4555
001011102E4656
001011112F4757
00110000304860
00110001314961
00110010325062
00110011335163
00110100345264
00110101355365
00110110365466
00110111375567
00111000385670
00111001395771
001110103A5872
001110113B5973
001111003C6074
001111013D6175
001111103E6276
001111113F6377
010000004064100
010000014165101
010000104266102
010000114367103
010001004468104
010001014569105
010001104670106
010001114771107
010010004872110
010010014973111
010010104A74112
010010114B75113
010011004C76114
010011014D77115
010011104E78116
010011114F79117
010100005080120
010100015181121
010100105282122
010100115383123
010101005484124
010101015585125
010101105686126
010101115787127
010110005888130
010110015989131
010110105A90132
010110115B91133
010111005C92134
010111015D93135
010111105E94136
010111115F95137
011000006096140
011000016197141
011000106298142
011000116399143
0110010064100144
0110010165101145
0110011066102146
0110011167103147
0110100068104150
0110100169105151
011010106A106152
011010116B107153
011011006C108154
011011016D109155
011011106E110156
011011116F111157
0111000070112160
0111000171113161
0111001072114162
0111001173115163
0111010074116164
0111010175117165
0111011076118166
0111011177119167
0111100078120170
0111100179121171
011110107A122172
011110117B123173
011111007C124174
011111017D125175
011111107E126176
011111117F127177
1000000080128200
1000000181129201
1000001082130202
1000001183131203
1000010084132204
1000010185133205
1000011086134206
1000011187135207
1000100088136210
1000100189137211
100010108A138212
100010118B139213
100011008C140214
100011018D141215
100011108E142216
100011118F143217
1001000090144220
1001000191145221
1001001092146222
1001001193147223
1001010094148224
1001010195149225
1001011096150226
1001011197151227
1001100098152230
1001100199153231
100110109A154232
100110119B155233
100111009C156234
100111019D157235
100111109E158236
100111119F159237
10100000A0160240
10100001A1161241
10100010A2162242
10100011A3163243
10100100A4164244
10100101A5165245
10100110A6166246
10100111A7167247
10101000A8168250
10101001A9169251
10101010AA170252
10101011AB171253
10101100AC172254
10101101AD173255
10101110AE174256
10101111AF175257
10110000B0176260
10110001B1177261
10110010B2178262
10110011B3179263
10110100B4180264
10110101B5181265
10110110B6182266
10110111B7183267
10111000B8184270
10111001B9185271
10111010BA186272
10111011BB187273
10111100BC188274
10111101BD189275
10111110BE190276
10111111BF191277
11000000C0192300
11000001C1193301
11000010C2194302
11000011C3195303
11000100C4196304
11000101C5197305
11000110C6198306
11000111C7199307
11001000C8200310
11001001C9201311
11001010CA202312
11001011CB203313
11001100CC204314
11001101CD205315
11001110CE206316
11001111CF207317
11010000D0208320
11010001D1209321
11010010D2210322
11010011D3211323
11010100D4212324
11010101D5213325
11010110D6214326
11010111D7215327
11011000D8216330
11011001D9217331
11011010DA218332
11011011DB219333
11011100DC220334
11011101DD221335
11011110DE222336
11011111DF223337
11100000E0224340
11100001E1225341
11100010E2226342
11100011E3227343
11100100E4228344
11100101E5229345
11100110E6230346
11100111E7231347
11101000E8232350
11101001E9233351
11101010EA234352
11101011EB235353
11101100EC236354
11101101ED237355
11101110EE238356
11101111EF239357
11110000F0240360
11110001F1241361
11110010F2242362
11110011F3243363
11110100F4244364
11110101F5245365
11110110F6246366
11110111F7247367
11111000F8248370
11111001F9249371
11111010FA250372
11111011FB251373
11111100FC252374
11111101FD253375
11111110FE254376
11111111FF255377

Common Binary Numbers in Hex

NumberBinaryHexDecimal
Subnet mask octet (/25)1000000080128
Subnet mask octet (/26)11000000C0192
Subnet mask octet (/27)11100000E0224
Subnet mask octet (/28)11110000F0240
Subnet mask octet (/29)11111000F8248
Subnet mask octet (/30)11111100FC252
Subnet mask octet (/31)11111110FE254
Subnet mask octet (/24)11111111FF255
SSH port101101622
SMTP port110011925
DNS port1101013553
HTTP port10100005080
HTTPS port1101110111BB443
MySQL port110011101010CEA3306
PostgreSQL port101010011100015385432
Alternate HTTP port11111100100001F908080
Loopback first octet11111117F127
Private IP first octet (10.x.x.x)1010A10
Private IP first octet (192.168.x.x)11000000C0192
Private IP second octet (192.168.x.x)10101000A8168
Ten1010A10
One hundred110010064100
One thousand11111010003E81000
Max signed 8-bit11111117F127
Max unsigned 8-bit11111111FF255
Values in a byte100000000100256
One kibibyte100000000004001024
Page size100000000000010004096
Max signed 16-bit1111111111111117FFF32767
Max unsigned 16-bit1111111111111111FFFF65535
Values in 16 bits100000000000000001000065536
Max RGB hex FFFFFF111111111111111111111111FFFFFF16777215
Max signed 32-bit11111111111111111111111111111117FFFFFFF2147483647
Max unsigned 32-bit11111111111111111111111111111111FFFFFFFF4294967295
Days from 1970 to 2000101010110011012ACD10957
ASCII letter A10000014165
ASCII letter a11000016197
ASCII digit 01100003048
ASCII space1000002032
ASCII line feed1010A10

Common Hex Colors in Binary

ColorHexBinary (R G B)
Black#00000000000000 00000000 00000000
White#FFFFFF11111111 11111111 11111111
Red#FF000011111111 00000000 00000000
Green (lime)#00FF0000000000 11111111 00000000
Blue#0000FF00000000 00000000 11111111
Yellow#FFFF0011111111 11111111 00000000
Cyan#00FFFF00000000 11111111 11111111
Magenta#FF00FF11111111 00000000 11111111
Gray#80808010000000 10000000 10000000
Silver#C0C0C011000000 11000000 11000000
Orange#FFA50011111111 10100101 00000000
Navy#00008000000000 00000000 10000000
Teal#00808000000000 10000000 10000000
Maroon#80000010000000 00000000 00000000
Olive#80800010000000 10000000 00000000
Purple#80008010000000 00000000 10000000

Binary Fractions in Hex

BinaryHex
0.10.8
0.010.4
0.0010.2
0.00010.1
0.1010.A
0.11110.F
1.11.8
10.012.4
101.0115.6
1000.00018.1
1101.101D.A
101110.0112E.6
11.0010013.24
0.00011001100110010.1999

Technical Q&A / FAQ Matrix

Technical Developer QuestionExact 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.