Everything2
Near Matches
Ignore Exact
Full Text
Everything2

Binary to Hexadecimal

created by pealco

(idea) by Mike1024 (2.9 y) (print)   ?   (I like it!) 1 C! Sun Jan 07 2001 at 21:00:48

Converting Binary to Hexadecimal is easy, once you know the technique. I will dispense this technique... wait for it... now:

First, write your binary number down. It's easiest that way.

10110010
Now, divide that number into groups of four numbers:

1011 0010
Now, with each of these groups, write numbers underneath the letters, from RIGHT TO LEFT. These numbers start with one, and double each time, i.e. 1 2 4 8. Now you should have:

1011 0010
8421 8421
Now, for each digit, multiply the top digit by the bottom digit, and write it underneath, like this:

1011 0010
8421 8421
8021 0020
that is, if the binary digit it one, you write the number. If it's 0, you write 0.

Now, on the bottom line, for each group of four numbers, add them up:

8021 0020

8 + 0 + 2 + 1 = 11
0 + 0 + 2 + 0 = 2

  11    2
Now, as you probably know if you care enough to read this far, Hexadecimal has sixteen numbers. Here they are, with thier decimal equivilents:

Dec - Hex
0 --- 0
1 --- 1
2 --- 2
3 --- 3
4 --- 4
5 --- 5
6 --- 6
7 --- 7
8 --- 8
9 --- 9
10 -- A
11 -- B
12 -- C
13 -- D
14 -- E
15 -- F
Now, take any numbers that are above nine and put in thier letter, i.e.

11   2
B    2
Now, take all the letters and numbers on the bottom line and put them togther in one number:

B2 

And blammo, Binary to hexadecimal. With a bit of practice, you can learn to do this in your head. Here are some more examples, to outline some other points:

Firstly, if the number of Binary digits doesn't divide into four nicely, add 0s onto the START until it does. Example:

 1011101 changes to
01011101 then proceed as normal:
0101 1101
8421 8421
0401 8401

0 + 4 + 0 + 1 = 5
8 + 4 + 0 + 1 = 13

   5   13
   5    D

5D
Here is one final example, with comments that some people think are easier to follow:

Original Binary:            1101011010001
Add '0's:                   0001101011010001
Divide into little groups:  0001 1010 1101 0001
Write down 8421s:           8421 8421 8421 8421
Multiply:                   0001 8020 8401 0001
Add the groups of 4 up:        1   10   13    1
But in letters if needed:      1    A    D    1
Result:                                    1AD1
And that, my friends, is how we convert binary to Hex. Next, I'll write up Binary to Octal.

(idea) by iandunn (1.3 mon) (print)   ?   (I like it!) Mon May 13 2002 at 16:39:57

Here's a different (and IMHO quicker/easier) way to do it. First you'll need a chart comparing binary and hex values:

--------------------------------------
|   Binary   |   Hexadecimal   |
--------------------------------------
|    0000    |              0              |
|    0001    |              1              |
|    0010    |              2              |
|    0011    |              3              |
|    0100    |              4              |
|    0101    |              5              |
|    0110    |              6              |
|    0111    |              7              |
|    1000    |              8              |
|    1001    |              9              |
|    1010    |              A              |
|    1011    |              B              |
|    1100    |              C             |
|    1101    |              D             |
|    1110    |              E             |
|    1111    |              F              |
--------------------------------------

Ok, now, say you've got a binary number: 101100101100. Starting from right to left, divide the number into segments, each containing 4 numbers. Which will give you: 1011, 0010 and 1100. Then, look at the chart and find the hexadecimal values for each of those binary values:

                           ---------------------------------
Binary               |  1011  |  0010  |  1100  |
                           ---------------------------------
Hexadecimal  |     B      |     2      |     C     |
                           ---------------------------------

Then, just remove the spaces inbetween the hexadecimal values, and voila!, you've got your hexadecimal equalvalent of the binary value you started with.

101100101100B = B2CH


I'd like to give a shout out to dann's E2 Offline Scratchpad for helping to make those charts.


printable version
chaos

Binary to Octal Binary to decimal hexadecimal E2 Offline Scratchpad
decimal to binary binary Sometimes, my paranoia overtakes me and I find myself asking, "IS ONE OF THE E2 EDITORS OUT TO GET ME!?" nine
octal The Base project Chart Convert any number to decimal
A boxed comments Final Comments from Judge Parker to Wen Ho Lee, part one voilą
CIDR Hexadecimal to binary IMHO
Y'know, if you log in, you can write something here, or contact authors directly on the site. Create a New User if you don't already have an account.
  Epicenter
Login
Password

password reminder
register

Everything2 Help

Cool Staff Picks
Nodes your grandpa would have liked:
public executions
Rosa Parks
Ultima Thule
booster
World of Warcraft
Straight razor shave
One Night I Think
Destruction of Syntax - Imagination without Strings - Words-in-Freedom
Zardoz
Lost in translation
The Half Asian Identity
free lunch
Shroud of Turin
New Writeups
antigravpussy
One fly amongst many(person)
sam512
Moon Base Shackleton, 1978(fiction)
Pavlovna
toy boy(person)
XWiz
tear jerker(review)
Heitah
Anarchy is Order(idea)
jessicaj
July 26, 2008(dream)
Berek
ABBA(person)
devolution
k-hole(place)
Nadine_2
The Sound Of Madness(review)
SwimmingMonkey
Conversations with Fo Fo, the Loneliest dog in Purgatory(fiction)
locke baron
lynx(thing)
Simulacron3
Reality, Dimensions and the Natural Ontology(essay)
SubSane
Making Love to a 9-Foot Woman(person)
Ouzo
Thoughts(idea)
antigravpussy
I fall silent, listening. The breadcrumbs are talking about us(person)
This page courtesy of The Everything Development Company