What Is Binary Code and How Does Binary Conversion Work?

What Is Binary Code and How Does Binary Conversion Work?

Binary code is a way of writing numbers using only two digits, 0 and 1. Computers use it because their circuits have two states, off and on. Each digit is a bit, 8 bits make a byte, and every letter, image and program is stored as patterns of these bits.

What Is Binary Code and How Does Binary Conversion Work?

Ключевые факты

  • Base 2 number system – digits 0 and 1 only
  • 1 bit = one 0 or 1 · 1 byte = 8 bits = 256 possible values
  • Place values double: 1, 2, 4, 8, 16, 32, 64, 128 …
  • Hexadecimal is shorthand: 1 hex digit = 4 bits

Counting in binary

Counting in binary

💻 Our normal decimal system has ten digits and each place is worth ten times the one to its right. Binary has two digits and each place is worth double. Reading right to left, the places are 1, 2, 4, 8, 16 and so on.

Десятичное числоДвоичный кодHex
000000
100011
200102
501015
910019
101010A
131101D
151111F
25511111111FF

Decimal to binary by hand

Decimal to binary by hand

Example: convert 13

  1. 13 ÷ 2 = 6, remainder 1
  2. 6 ÷ 2 = 3, remainder 0
  3. 3 ÷ 2 = 1, remainder 1
  4. 1 ÷ 2 = 0, remainder 1

Read the remainders bottom to top: 1101. Check: 8 + 4 + 1 = 13.

Going back is simple addition: for 1101, add the place values under each 1 – 8 + 4 + 0 + 1 = 13. For larger numbers, Decimal to Binary and Binary to Decimal do it instantly.

Where you meet binary every day

Where you meet binary every day
  • Text: each character is stored as one or more bytes – "A" is 01000001.
  • Images: each pixel's colour is stored as numbers, often written in hex like #FF0000 for red.
  • Networks: IP addresses such as 192.168.1.1 are four bytes.
  • File sizes: KB, MB and GB all count bytes.

Binary, hex and text together

Programmers rarely type long strings of 0s and 1s. They use hex because one hex digit replaces four bits: 11111111 becomes FF. Text becomes binary through character codes such as ASCII and UTF-8 – try Text to Binary to see your name in bits, or Binary to Hex to shorten long binary.

Попробуйте бесплатный инструмент «Десятичный в двоичный код» прямо сейчас

Откройте «Десятичный в двоичный код» на pdfseotools.com – бесплатно, без регистрации и на любом устройстве.

Открыть «Десятичный в двоичный код» →

Часто задаваемые вопросы

Why do computers use binary?

Electronic circuits are most reliable with two clear states – on or off, high or low voltage. Two states map perfectly to 1 and 0.

What is a bit and a byte?

A bit is a single 0 or 1. A byte is 8 bits, enough for 256 different values (0 to 255).

How do I convert decimal to binary by hand?

Divide the number by 2 repeatedly and write down the remainders, then read them from bottom to top. 13 → 1101.

What is hexadecimal used for?

Hex is a short way to write binary: each hex digit stands for exactly 4 bits. Colour codes like #FF5733 and memory addresses use it.

How many values can 8 bits store?

2 to the power of 8 = 256 values, from 00000000 (0) to 11111111 (255).

Is binary still used in modern computers?

Yes. Every file, photo, app and web page is ultimately stored and processed as binary.

Краткий итог

Binary is counting with two digits, where each place doubles in value. Once you know the place values 1, 2, 4, 8, 16, 32, 64 and 128, you can read any byte. Explore the free binary converters to practise.


Поделиться в соцсетях: