Return
to tool
Numbers & Bases

Binary Converter

A binary converter that handles what people actually arrive needing: text to binary and back, as well as decimal, hexadecimal and octal. Pick a base or paste ASCII text, and everything updates live in both directions. It supports signed values with 8-, 16-, 32- and 64-bit two's complement, binary fractions, and a working panel that shows the arithmetic for your own input rather than just the answer. Reference tables below cover ASCII codes, powers of two and cross-base values.

Binary Converter

Text to binary and back, or convert between binary, decimal, hex and octal. Everything updates live.

Auto width · unsigned

Show the working

Type a value above and the arithmetic for your own input appears here, step by step.

Text and binary: what a binary translator actually does

When people ask to convert text to binary, they are asking for two steps at once. First each character becomes a number — its character code — and then that number becomes binary. The letter A is character code 65, and 65 in binary is 01000001. Nothing about the letter A is inherently binary; the number in between is doing the work.

That intermediate number comes from an encoding standard. ASCII, defined in the 1960s, covers 128 characters — the English alphabet in both cases, digits, punctuation and some control codes — which fits in seven bits, conventionally padded to eight. UTF-8 extends this to every character in Unicode while keeping the first 128 identical to ASCII, which is why plain English text is byte-for-byte the same in both. Characters beyond that range, including accented letters and emoji, use two to four bytes in UTF-8.

This is why a binary translator needs an encoding setting and why results differ between tools that do not have one. It is also why binary text is conventionally written in groups of eight separated by spaces: each group is one byte, which is one character in ASCII. Strip the spaces and the string is still valid, but a human can no longer see where one character ends and the next begins.

CharacterCode pointBinary (8-bit)Note
(tab)900001001Escape \t
(newline)1000001010Escape \n
(carriage return)1300001101
(space)3200100000Word separator
!3300100001
"3400100010
#3500100011
$3600100100
%3700100101
&3800100110
'3900100111
(4000101000
)4100101001
*4200101010
+4300101011
,4400101100
-4500101101
.4600101110
/4700101111
04800110000Digits start at 48
14900110001
25000110010
35100110011
45200110100
55300110101
65400110110
75500110111
85600111000
95700111001Digits end at 57
:5800111010
;5900111011
<6000111100
=6100111101
>6200111110
?6300111111
@6401000000
A6501000001Uppercase starts at 65
B6601000010
C6701000011
D6801000100
E6901000101
F7001000110
G7101000111
H7201001000
I7301001001
J7401001010
K7501001011
L7601001100
M7701001101
N7801001110
O7901001111
P8001010000
Q8101010001
R8201010010
S8301010011
T8401010100
U8501010101
V8601010110
W8701010111
X8801011000
Y8901011001
Z9001011010Uppercase ends at 90
[9101011011
\9201011100
]9301011101
^9401011110
_9501011111
`9601100000
a9701100001Lowercase starts at 97
b9801100010
c9901100011
d10001100100
e10101100101
f10201100110
g10301100111
h10401101000
i10501101001
j10601101010
k10701101011
l10801101100
m10901101101
n11001101110
o11101101111
p11201110000
q11301110001
r11401110010
s11501110011
t11601110100
u11701110101
v11801110110
w11901110111
x12001111000
y12101111001
z12201111010Lowercase ends at 122
{12301111011
|12401111100
}12501111101
~12601111110
(delete)12701111111

Worked example: the word Hello

Take each letter in turn. H is 72, e is 101, l is 108, l is 108 again, and o is 111. Convert each to eight bits and you get 01001000 01100101 01101100 01101100 01101111. Five characters, five bytes, forty bits. Reversing the process means splitting the string into groups of eight, converting each back to a number, and looking the number up as a character.

How binary works as a number system

Binary is base 2, so it uses only 0 and 1, and every place is worth twice the one to its right: 1, 2, 4, 8, 16, 32 and onward. Decimal 10 is written 1010 in binary because it is one eight, no fours, one two and no ones.

Computers use binary because a physical component can reliably hold two states — charged or not, high voltage or low — but distinguishing ten distinct voltage levels reliably is far harder. Everything above that layer is convention built on the same two symbols. It is also why powers of two appear everywhere in computing: 256, 1024, 65536 are round numbers in binary even though they look arbitrary in decimal.

PowerValueBinaryWhere it shows up
2^011Least significant bit
2^1210
2^24100
2^381000One nibble of range
2^41610000Hex digit ceiling
2^532100000ASCII space
2^6641000000
2^712810000000Signed byte boundary
2^8256100000000One byte of range
2^95121000000000
2^10102410000000000One kibibyte
2^112048100000000000
2^1240961000000000000Memory page
2^13819210000000000000
2^1416384100000000000000
2^15327681000000000000000Signed 16-bit boundary
2^166553610000000000000000Port number ceiling
2^201048576(21 bits)One mebibyte
2^2416777216(25 bits)24-bit colour range
2^312147483648(32 bits)Signed 32-bit boundary
2^324294967296(33 bits)Unsigned 32-bit range

Converting decimal to binary by hand

  1. Divide the decimal number by 2.
  2. Write down the quotient and the remainder — the remainder is always 0 or 1.
  3. Replace the number with the quotient and repeat.
  4. Stop when the quotient reaches 0.
  5. Read the remainders from the bottom up. That is your binary number.

For 10: 10 divided by 2 is 5 remainder 0; 5 divided by 2 is 2 remainder 1; 2 divided by 2 is 1 remainder 0; 1 divided by 2 is 0 remainder 1. Reading bottom-to-top gives 1010. Going the other way is easier — write the place values above the bits and add up the ones. For 1010: 8 + 0 + 2 + 0 = 10.

StepDivisionQuotientRemainder
110 / 250
25 / 221
32 / 210
41 / 201

The working panel on the converter above generates this same table live for any number you type.

Negative numbers and two's complement

Binary has no minus sign. Negative values are stored using two's complement, which means the answer depends entirely on how many bits you are working in — so there is no single binary pattern that means 'negative five' without stating the width first.

The rule: to represent a negative number in a given width, add it to two raised to that width. For -5 in 8 bits, 256 - 5 = 251, which is 11111011. In 16 bits it is 1111111111111011. The giveaway is the leading bit — in a signed value, a top bit of 1 always means negative. This is also why an 8-bit signed value only reaches 127 upward but -128 downward: the patterns are not symmetrical.

Decimal8-bit binary8-bit hex16-bit binary
127011111117F0000000001111111
100000001010000000000000001
000000000000000000000000000
-111111111FF1111111111111111
-211111110FE1111111111111110
-511111011FB1111111111111011
-1011110110F61111111111110110
-1611110000F01111111111110000
-3211100000E01111111111100000
-6411000000C01111111111000000
-100100111009C1111111110011100
-12710000001811111111110000001
-12810000000801111111110000000

Binary fractions and why 0.1 is a problem

Bits after a binary point are negative powers of two: the first is a half, the second a quarter, the third an eighth. So 0.11 in binary is a half plus a quarter, or 0.75, and 0.101 is a half plus an eighth, or 0.625.

The catch is that many ordinary decimal fractions have no exact binary representation. 0.1 is the famous one — in binary it repeats forever as 0.000110011001100..., in the same way one third repeats in decimal. Computers store a truncated approximation, which is why 0.1 + 0.2 does not equal 0.3 in most programming languages. That behaviour surprises people constantly, and it is a direct consequence of the arithmetic in this table rather than a bug.

BinaryDecimalFractionExact?
0.10.51/2Yes
0.010.251/4Yes
0.110.753/4Yes
0.0010.1251/8Yes
0.1010.6255/8Yes
0.1110.8757/8Yes
0.00010.06251/16Yes
0.11110.937515/16Yes
101.1015.6255 5/8Yes
0.0001100110011...0.11/10No — repeats forever
0.010011001100...0.33/10No — repeats forever
0.0101010101...1/31/3No — repeats forever

Cross-base reference

Binary, decimal, hex and octal

BinaryDecimalHexOctal
00000000000000
00000001101001
00000010202002
00000011303003
00000100404004
00000101505005
00000110606006
00000111707007
00001000808010
00001001909011
00001010100A012
00001011110B013
00001100120C014
00001101130D015
00001110140E016
00001111150F017
000100001610020
000100011711021
000100101812022
000100111913023
000101002014024
000101012115025
000101102216026
000101112317027
000110002418030
000110012519031
00011010261A032
00011011271B033
00011100281C034
00011101291D035
00011110301E036
00011111311F037
001000003220040
001000013321041
001000103422042
001000113523043
001001003624044
001001013725045
001001103826046
001001113927047
001010004028050
001010014129051
00101010422A052
00101011432B053
00101100442C054
00101101452D055
00101110462E056
00101111472F057
001100004830060
001100014931061
001100105032062
001100115133063
001101005234064
001101015335065
001101105436066
001101115537067
001110005638070
001110015739071
00111010583A072
00111011593B073
00111100603C074
00111101613D075
00111110623E076
00111111633F077
010000006440100
010000016541101
010000106642102
010000116743103
010001006844104
010001016945105
010001107046106
010001117147107
010010007248110
010010017349111
01001010744A112
01001011754B113
01001100764C114
01001101774D115
01001110784E116
01001111794F117
010100008050120
010100018151121
010100108252122
010100118353123
010101008454124
010101018555125
010101108656126
010101118757127
010110008858130
010110018959131
01011010905A132
01011011915B133
01011100925C134
01011101935D135
01011110945E136
01011111955F137
011000009660140
011000019761141
011000109862142
011000119963143
0110010010064144
0110010110165145
0110011010266146
0110011110367147
0110100010468150
0110100110569151
011010101066A152
011010111076B153
011011001086C154
011011011096D155
011011101106E156
011011111116F157
0111000011270160
0111000111371161
0111001011472162
0111001111573163
0111010011674164
0111010111775165
0111011011876166
0111011111977167
0111100012078170
0111100112179171
011110101227A172
011110111237B173
011111001247C174
011111011257D175
011111101267E176
011111111277F177
1000000012880200
1000000112981201
1000001013082202
1000001113183203
1000010013284204
1000010113385205
1000011013486206
1000011113587207
1000100013688210
1000100113789211
100010101388A212
100010111398B213
100011001408C214
100011011418D215
100011101428E216
100011111438F217
1001000014490220
1001000114591221
1001001014692222
1001001114793223
1001010014894224
1001010114995225
1001011015096226
1001011115197227
1001100015298230
1001100115399231
100110101549A232
100110111559B233
100111001569C234
100111011579D235
100111101589E236
100111111599F237
10100000160A0240
10100001161A1241
10100010162A2242
10100011163A3243
10100100164A4244
10100101165A5245
10100110166A6246
10100111167A7247
10101000168A8250
10101001169A9251
10101010170AA252
10101011171AB253
10101100172AC254
10101101173AD255
10101110174AE256
10101111175AF257
10110000176B0260
10110001177B1261
10110010178B2262
10110011179B3263
10110100180B4264
10110101181B5265
10110110182B6266
10110111183B7267
10111000184B8270
10111001185B9271
10111010186BA272
10111011187BB273
10111100188BC274
10111101189BD275
10111110190BE276
10111111191BF277
11000000192C0300
11000001193C1301
11000010194C2302
11000011195C3303
11000100196C4304
11000101197C5305
11000110198C6306
11000111199C7307
11001000200C8310
11001001201C9311
11001010202CA312
11001011203CB313
11001100204CC314
11001101205CD315
11001110206CE316
11001111207CF317
11010000208D0320
11010001209D1321
11010010210D2322
11010011211D3323
11010100212D4324
11010101213D5325
11010110214D6326
11010111215D7327
11011000216D8330
11011001217D9331
11011010218DA332
11011011219DB333
11011100220DC334
11011101221DD335
11011110222DE336
11011111223DF337
11100000224E0340
11100001225E1341
11100010226E2342
11100011227E3343
11100100228E4344
11100101229E5345
11100110230E6346
11100111231E7347
11101000232E8350
11101001233E9351
11101010234EA352
11101011235EB353
11101100236EC354
11101101237ED355
11101110238EE356
11101111239EF357
11110000240F0360
11110001241F1361
11110010242F2362
11110011243F3363
11110100244F4364
11110101245F5365
11110110246F6366
11110111247F7367
11111000248F8370
11111001249F9371
11111010250FA372
11111011251FB373
11111100252FC374
11111101253FD375
11111110254FE376
11111111255FF377
100000000256100400
1111101005001F4764
10000000005122001000
111110100010003E81750
1000000000010244002000
1111111111114095FFF7777
10000000000004096100010000
111111111111111165535FFFF177777

The Hex column is covered in depth by the decimal to hex converter, and the Octal column by the binary to octal converter.

Common byte patterns

BinaryHexDecimalWhat it is
00000000000Null byte
00000001011Low bit set
000011110F15Low nibble mask
000100001016
001111113F636-bit mask
010000004064
011111117F127Max signed byte
1000000080128Min signed byte; sign bit only
10101010AA170Alternating, starting high
010101015585Alternating, starting low
11000000C0192Top two bits
11110000F0240High nibble mask
11111110FE254All but low bit
11111111FF255Max byte; all bits set

Each byte here collapses to exactly two hex digits — the binary to hexadecimal converter covers that nibble grouping in depth.

Where binary actually shows up

Puzzles, ciphers and novelty

A large share of text-to-binary conversions are people decoding something they were sent — an escape-room clue, a puzzle hunt, a tattoo, a t-shirt, a message from a friend being clever. This is a real and legitimate use and it is why binary translators outrank binary calculators on this term. The text tab is built for pasting an unknown string and getting an answer without needing to understand encodings first.

Bitmasks and flags in code

When one value packs several on/off settings, each bit is one flag. Checking whether a flag is set means a bitwise AND against a mask: 0F keeps the low four bits, F0 keeps the high four. Reading a flags value usually means converting it to binary and looking at which positions are 1, which is what the byte-patterns table above is for.

File sizes and why 1 KB isn't 1,000 bytes

Storage counts in powers of two, so a kibibyte is 1,024 bytes rather than 1,000. Drive manufacturers advertise in decimal units while operating systems have historically reported in binary ones, which is why a drive sold as 500 GB shows up as roughly 465 GB. Both numbers are correct; they are counting in different bases.

Floating point and the 0.1 problem

Because decimal fractions like 0.1 have no exact binary form, computers store approximations, and small errors accumulate. This is why financial code uses fixed-point or decimal types rather than floats, and why comparing two floating-point numbers for exact equality is a common source of bugs. The fractions table above shows exactly which values are exact and which are not.

Networking and permissions

Subnet masks are binary patterns written in decimal — 255.255.255.0 is twenty-four 1s followed by eight 0s. Unix file permissions are three groups of three bits. Both are cases where the decimal or octal form is a shorthand for a bit pattern, and reading them means converting back.

Who uses this and why

Puzzle solvers and the curious

Decoding a binary string found somewhere, or encoding one to send. The text tab defaults to space-delimited 8-bit groups because that is how such strings are almost always written, and it accepts undelimited input too.

Students

Base conversion, two's complement and floating-point representation are standard coursework assessed on method. The working trace shows the division steps and bit-weight expansion for your own numbers rather than only the answer.

Software developers

Reading bitmasks, checking register values, debugging encoding issues and understanding why a float comparison failed. The bit-width and signed controls matter most here — the same pattern means different things at 8, 16 and 32 bits.

Network and systems engineers

Subnet arithmetic, permission bits and packet inspection are binary-native tasks usually expressed in decimal or hex shorthand. Converting quickly in both directions is routine rather than occasional.

Frequently Asked Questions

How do I convert text to binary?

Each character becomes its character code, and that number becomes binary, padded to eight bits. A is code 65, which is 01000001. Paste text into the Text field above and the binary appears immediately, space-separated by byte.

How do I convert binary to text?

Split the binary into groups of eight, convert each group to a decimal number, then look that number up as a character. 01001000 is 72, which is H. The converter above does this in either direction and accepts input with or without spaces.

How do I convert decimal to binary?

Divide by 2 repeatedly, noting each remainder, and read the remainders from the bottom up. 10 gives remainders 0, 1, 0, 1 reading upward, so 10 is 1010. The working panel shows every step for your own number.

What is 01001000 in text?

01001000 is 72 in decimal, which is the character H. It is the first byte of 'Hello', whose full binary form is 01001000 01100101 01101100 01101100 01101111.

Why do computers use binary?

Because a physical component can hold two states reliably — on or off, high or low voltage — while distinguishing ten separate levels is far harder and more error-prone. Everything above that layer is built on those two symbols.

What is a bit, a nibble and a byte?

A bit is a single 0 or 1. Four bits make a nibble, which is exactly one hexadecimal digit. Eight bits make a byte, which is one ASCII character and two hex digits, and can hold values from 0 to 255.

How do negative numbers work in binary?

Through two's complement: add the negative value to 2 raised to the bit width. -5 in 8 bits is 256 - 5 = 251, or 11111011. The answer changes with the width, so -5 in 16 bits is 1111111111111011. A leading 1 always signals a negative signed value.

Can binary represent fractions?

Yes — bits after the point are halves, quarters, eighths and so on, so 0.11 is 0.75. But many decimal fractions have no exact binary form: 0.1 repeats forever, which is why 0.1 + 0.2 does not equal exactly 0.3 in most programming languages.

What's the difference between binary and ASCII?

Binary is a number system; ASCII is a table mapping characters to numbers. Converting text to binary uses both — ASCII supplies the number for each character, binary is how that number is written.

How do I convert binary to hex quickly?

Group the bits into fours from the right and convert each group to one hex digit, since 16 is 2 to the fourth. 11111111 splits into 1111 and 1111, giving FF. No division is needed.

What do 8-bit, 16-bit and 32-bit mean?

They describe how many binary digits a value uses, which sets its range. An unsigned 8-bit value holds 0 to 255; 16-bit holds 0 to 65,535; 32-bit holds 0 to about 4.29 billion. Signed values split that range across positive and negative.

Mini About Us

We built the Binary Converter because every other page makes you pick one conversion and open three more tabs for the rest. This one does text, decimal, hex and octal from a single input, and shows you the working instead of just the answer. This site is a part of the ads4good Network.

Read more about Utility Commons here