VITON13 SCHOOL · Codes and ciphers
Binary translator and binary converter
Text to binary and back, numbers in any base from 2 to 36 — everything updates as you type, with the working shown the way a textbook writes it.
Number converter
Type in any field and the others update as you type. Spaces are ignored, a point or a comma starts the fraction, and brackets mark a repeating part: 0.(3).
Bits: 11 · bytes: 2
Step by step
From base 10 to base 2
Whole part: divide by 2
Divide by 2 until the quotient is 0. Each remainder is one digit of the answer.
| Division | Quotient | Remainder |
|---|---|---|
| 2026 ÷ 2 | 1013 | 0 |
| 1013 ÷ 2 | 506 | 1 |
| 506 ÷ 2 | 253 | 0 |
| 253 ÷ 2 | 126 | 1 |
| 126 ÷ 2 | 63 | 0 |
| 63 ÷ 2 | 31 | 1 |
| 31 ÷ 2 | 15 | 1 |
| 15 ÷ 2 | 7 | 1 |
| 7 ÷ 2 | 3 | 1 |
| 3 ÷ 2 | 1 | 1 |
| 1 ÷ 2 | 0 | 1 |
Read the remainders from the bottom up2026₁₀ = 11111101010₂
Answer2026₁₀ = 11111101010₂
Text
Type on either side. Binary and hex can be pasted with or without spaces. The bytes are UTF-8, so accents, Cyrillic and emoji work.
Characters: 5 · bytes: 5 · bits: 40
Character by character
UTF-8 writes a Latin letter in 1 byte, Cyrillic in 2, € in 3 and most emoji in 4. The light bits say how many bytes belong together; the dark bits are the character's own number.
- HU+0048
0100100048 - eU+0065
0110010165 - lU+006C
011011006C - lU+006C
011011006C - oU+006F
011011116F
Two's complement
How a computer stores whole numbers, negative ones included, in a fixed number of bits.
Signed: from -128 to 127. Unsigned: from 0 to 255.
Tap a bit to flip it
- Signed
- -5
- Unsigned
- 251
- Hex
- 0xFB
- Binary
- 1111 1011
How -5 is written
- 5 in 8 bits
0000 0101 - Invert every bit
1111 1010 - Add 1
1111 1011
0 to 15 in four systems
Tap a row to open the number in the converter.
Powers of two
How to use the binary converter
- Type text or a numberOn the Text tab, type on either side: letters turn into UTF-8 bytes, and pasted binary, hex or decimal bytes turn back into text. On the Numbers tab, type in any field — binary, octal, decimal, hex or any base.
- Read the stepsUnder the converter, the solution is written out: repeated division for the whole part, multiplication for the fraction, place values back to decimal, and groups of four bits between binary and hex.
- Check signed numbersThe Signed tab shows two's complement in 8, 16, 32 or 64 bits with the range. Tap any bit to flip it, and the table tab lists 0–15 and the powers of two.
How positional number systems work
In a positional system each place is worth the base raised to a power: in binary the places are 1, 2, 4, 8, 16 and so on, so 1011₂ = 8 + 0 + 2 + 1 = 11₁₀. Bases above 10 need more digit symbols, so letters are used: A = 10, B = 11, up to Z = 35 in base 36.
A fraction ends in a base only when its denominator, in lowest terms, has no prime factors other than those of the base. 1/10 has the factor 5, which 2 does not have, so 0.1 has no finite binary form: it is 0.0(0011)₂, with 0011 repeating forever. The converter finds such cycles and shows them in brackets.
Computers store text as numbers. UTF-8, the most common text encoding on the web, writes each character in 1 to 4 bytes: the letter A is one byte, 01000001; the Cyrillic Я is two bytes, D0 AF; € is three; most emoji are four. Negative whole numbers are usually stored in two's complement.
Questions about binary
How do you convert decimal to binary?
Divide the number by 2 again and again until the quotient is 0, writing down each remainder. Read the remainders from the bottom up: 11 gives 1, 1, 0, 1, so 11₁₀ = 1011₂. The converter writes this table for any number.
How do you translate text to binary?
Each character is turned into bytes by an encoding, usually UTF-8, and each byte is written as eight bits. Hi becomes 01001000 01101001. Letters outside the Latin alphabet take more than one byte, which the character table shows.
Why does 0.1 never end in binary?
Only fractions whose denominator is a power of 2 end in binary. 0.1 is 1/10, and 10 has the factor 5, so the binary digits repeat forever: 0.0(0011)₂. This is also why 0.1 + 0.2 is not exactly 0.3 in most programming languages.
What is two's complement?
It is the usual way to store negative whole numbers in a fixed number of bits: write the absolute value in binary, invert every bit and add 1. In 8 bits −5 is 11111011, and the range is from −128 to 127.
Sources
Related guides
More tools
Codes and ciphers