# How do you convert a binary number into hexadecimal?

Add enough zeroes to the start of the binary string to make the length a multiple of 4.

Translate four characters at a time to a single hex character.

If the characters are 0000, the hex character is 0

If the characters are 0001, the hex character is 1

If the characters are 0010, the hex character is 2

If the characters are 0011, the hex character is 3

If the characters are 0100, the hex character is 4

If the characters are 0101, the hex character is 5

If the characters are 0110, the hex character is 6

If the characters are 0111, the hex character is 7

If the characters are 1000, the hex character is 8

If the characters are 1001, the hex character is 9

If the characters are 1010, the hex character is A

If the characters are 1011, the hex character is B

If the characters are 1100, the hex character is C

If the characters are 1101, the hex character is D

If the characters are 1110, the hex character is E

If the characters are 1111, the hex character is F

Add 0x at the left of all the hex characters and terminate the ASCIIZ string with a zero character.