Subject:

## Binary Numbers Converter

Before starting a conversion you have to choose if the numbers are signed or unsigned.

The converter allows you to;

- convert binary to decimal numbers
- convert hexadecimal to decimal numbers
- convert hexadecimal to binary numbers
- convert binary to hexadecimal numbers
- convert decimal to hexadecimal numbers
- convert decimal to binary numbers
- determine the 2's complement of a binary number.
- do any of the conversions above for positive and negative numbers.

This binary converter is written in Javascript.

You may add this tool to your website or blog, by following the steps below:

**Step 1: **Insert the following Javascript code into the <head> tags of your page:

**Step 2: **Insert the following style commands into the <head> tags of your page. This step is optional and the converter will work the same way without these lines. However, if you want to keep the same style as seen on this page, you will need to add the following commands:

**Step 3: **Insert the following html code into the <body> tags of your page:

## Binary Fractions Converter

This online tool allows you to convert binary to decimal numbers.

## 1. Unsigned Binary Numbers - How to Convert From Unsigned Binary Numbers to Whole Numbers

The binary numbers can be signed, unsigned, integers or fractions. This is different than most online binary to decimal calculators, that usually only convert integers.

The calculator converts a binary unsigned number (b_{n}b_{n-1}...b_{0}.f_{1}f_{2}...f_{m}), to the decimal number b_{n}·2^{n} + b_{n-1}·2^{n-1} + ...

+ b_{1}·2^{1} + b_{0}·2^{0} + f_{1}·2^{-1} + f_{2}·2^{-2} + ... + f_{m}·2^{-m}.

For signed numbers b_{n} is the sign bit and the calculator converts (b_{n}b_{n-1}...b_{0}.f_{1}f_{2}...f_{m}), to the decimal number -b_{n}·2^{n} + b_{n-1}·2^{n-1} + ...

+ b_{1}·2^{1} + b_{0}·2^{0} + f_{1}·2^{-1} + f_{2}·2^{-2} + ... + f_{m}·2^{-m}.

If you are new to binary math, you may want to learn first the basics from the Swathmore website: Binary numbers