Binary Translator

Free binary translator: convert numbers between binary, octal, decimal, and hexadecimal, see the bit and byte count, and learn how ASCII turns text into binary.

https://hexacalculator.com/calculators/other/computers/binary-translator

Other

Computers

Binary Translator

Free binary translator: convert numbers between binary, octal, decimal, and hexadecimal, see the bit and byte count, and learn how ASCII turns text into binary.

Binary Translator

Enter a number

Converted values

(base 2)

(base 8)

Bits
Bytes
Hex digits
Largest value in these bits

In binary that is 10 1010, in octal 52, and in hexadecimal 0x2A.

All bases at a glance

The same number in every base

Base

Radix

Value

Binary20b 10 1010
Octal80o 52
Decimal1042
Hexadecimal160x 2A
Loading calculator…

A binary converter can convert numbers between the way computers and humans represent numbers. When you enter a value and select a number system, this tool will show its representation in binary, octal, decimal, and hexadecimal simultaneously.

Binary is the language of digital devices. Photos, messages and programs are stored at their most basic level as long strings of two symbols: 0 and 1. Each of these numbers is a bit, and eight bits make up one byte. Because it's difficult to read raw bit strings, converting between different number systems is one of the first skills you'll learn in computer science.

How to read binary code.

The binary system is a number system that is very similar to the decimal number we are already familiar with. In the decimal system each digit represents a power of ten. In the binary system, each digit represents a power of two and counting begins on the right; the rightmost digit being the power of 2 raised to zero.

Let's take the binary number 101010 as an example. We write down the powers of two and add up the corresponding places, taking into account that position 1 is considered.

Bit

1

0

1

0

1

0

Place value

32

16

8

4

2

1

Counts?

yes

no

yes

no

yes

no

If we add up all of these positions, we get this: 32 + 8 + 2 = 42. So the binary number 101010 is equivalent to the decimal number 42.

How to convert a decimal number to binary.

To convert it back to decimal, repeatedly divide by 2 and note the remainder. Divide the number by 2 and note the remainder (either 0 or 1), then divide the result again by 2. Continue until the result is 0, then read the remainders from bottom to top.

If you convert 42, the remainders from beginning to end are 0, 1, 0, 1, 0 and 1. If you read these from bottom to top, you get 101010, which is consistent with the result that would be obtained by direct conversion.

Binary, octal, decimal and hexadecimal systems:

In the octal system bits are grouped in threes and in hexadecimal they're grouped in fours, which is why programmers often use those systems as shorthand for long binary numbers. Each digit in hexadecimal represents exactly four bits, so a byte will always be represented by two digits in hexadecimal. Here are the first few values:

Decimal

Binary

Octal

Hex

0

0

0

0

1

1

1

1

2

10

2

2

5

101

5

5

8

1000

10

8

10

1010

12

A

16

10000

20

10

42

101010

52

2A

255

11111111

377

FF

Bits and Bytes

A single bit can store either a value of 0 or 1. Eight bits make up one byte and a byte can store 256 different values ranging from 0 to 255. Because of this range, a byte is sufficient to represent basic characters or a color channel.

This rule will soon be expanded. A single 16-bit value covers 2 to the power of 16, or 65,536 different possibilities, which is enough to represent tens of thousands of colors that could be displayed on a screen. With each additional bit, the range doubles.

Binary numbers and text: The connection to ASCII

Computers store characters as numbers. A character set is just a predefined table that assigns each character a code. ASCII, or American Standard Code for Information Interchange, is a classic character set where each character uses one byte.

To convert text to binary numbers, you first need to convert each character into its corresponding ASCII code and then write that code in binary. The uppercase letter A has a code of 65 which is represented as the 8-bit value 01000001. The number sign 0 has a code of 48, so it would be 00110000. The space character has a code of 32, which in binary is 00100000.

Character

ASCII code

Binary (8 bit)

A

65

01000001

a

97

01100001

0

48

00110000

Space

32

00100000

!

33

00100001

So a word is made up of a series of bytes. With the above tool, you can convert each character individually into its code and thus assemble the word in binary form.

Where is binary used?

The entire digital world is based on the binary system. Processor instructions, network packets, file formats and colors on your screen are all essentially encoded in binary. Boolean logic, or the algebra of "true" and "false", assigns a value of 1 to true and 0 to false. This is how circuits make decisions.

A Brief History of the Binary System

The modern binary system was founded by the German mathematician Gottfried Wilhelm Leibniz. He published his work in 1703 called "Explication de l'Arithmetique Binaire", where he showed that any number can be represented using only the values of 0 and 1. His inspiration came from the ancient Chinese book "I Ging" which describes states of disconnection and connection.

This idea is even older. Around 200 BCE the Indian scholar Pingala used a system with two states to represent the rhythms of poetry. The binary system was little known until engineers in the 20th century discovered that the "on" and "off" states of an electric switch corresponded perfectly to the values 0 and 1. This led to the digital computer.

Frequently asked questions

What can this binary converter tool be used for?

It can convert integers between binary, octal, decimal and hexadecimal. Enter a number and select the base to show the result in all other bases. The bit length and number of bytes are also shown at the same time.

How to convert binary numbers to decimal?

Set the input base to binary and enter 0s and 1s. Each digit represents a power of two, counting from the right. So the tool adds up the value of each digit that is a 1. For example, 101010 is equal to 32 + 8 + 2 which is 42.

How to convert decimal numbers to binary?

Leave the input base set to decimal and enter a normal number. The result will show the corresponding binary representation. If you want to convert manually, repeatedly divide by two and note each remainder. Then read the remainders from bottom to top.

What is the binary representation of the letter A?

In ASCII the code for the capital letter A is 65 and in an eight-digit representation it's 01000001. When a computer stores text, it first converts each character into its numeric code and then writes that code in binary.

Can words or sentences be converted to binary code?

Currently this tool can only convert numbers between different numeral systems. To represent text each character must be converted to its ASCII code and then converted to binary. A textbox that can encode whole sentences is listed as a planned extra feature.

What is the difference between a bit and a byte?

A bit is a single binary digit, either 0 or 1. A byte consists of eight bits and represents 256 values from 0 to 255. This is where hexadecimal comes in handy as two hexadecimal digits exactly represent one byte.

Related calculators

Disclaimer: This calculator is provided for general informational and educational purposes only. Our calculators are under active development, and results may be inaccurate, incomplete, or unsuitable for your situation. Always verify the figures independently and seek advice from a qualified professional before relying on them. We make no warranties and accept no liability for any loss or decision arising from use of this tool.

References

  1. Britannica: Binary number system

    Overview of base-two notation and its role in computing.

  2. NIST Special Publication 811: Guide for the Use of the International System of Units

    The US national standard for SI units, unit names and symbols, and conversion factors.