{"id":23812,"date":"2025-05-22T11:06:57","date_gmt":"2025-05-22T11:06:57","guid":{"rendered":"https:\/\/kwebby.com\/blog\/?p=23812"},"modified":"2026-10-04T13:26:58","modified_gmt":"2026-10-04T13:26:58","slug":"binary-number-system","status":"publish","type":"post","link":"https:\/\/kwebby.com\/blog\/binary-number-system\/","title":{"rendered":"Binary Number System Explained With Simple Examples"},"content":{"rendered":"<p>Binary is a way to write numbers using only 0 and 1. Each digit gets its value from its position. For example, 101 in binary means 5 in decimal because it contains one 4, no 2, and one 1.<\/p>\n<p>I\u2019ll start with those place values, then show you how to count, convert numbers in either direction, and check your answers. You won\u2019t need a calculator to follow the examples.<\/p>\n<h2 id=\"key-takeaways\">Key takeaways<\/h2>\n<ul><li>Binary is base 2, so each digit is either 0 or 1<\/li><li>Whole-number places start at 1 on the right and double as you move left<\/li><li>To convert binary to decimal, add the places marked with a 1<\/li><li>When converting by repeated division, read the remainders from bottom to top<\/li><li>Eight bits have 256 possible patterns; as an unsigned integer, their range is 0\u2013255<\/li><\/ul>\n<h2 id=\"what-is-the-binary-number-system\">What is the binary number system?<\/h2>\n<p>The binary number system uses two digits: 0 and 1. The decimal system you use for everyday counting has ten digits: 0 through 9.<\/p>\n<p>Both systems use place value. In decimal, the columns are ones, tens, hundreds, and so on. In binary, they are ones, twos, fours, eights, and so on.<\/p>\n<table><thead><tr><th scope=\"col\">Number system<\/th><th scope=\"col\">Allowed digits<\/th><th scope=\"col\">Place values, starting on the right<\/th><th scope=\"col\">How it writes five<\/th><\/tr><\/thead><tbody><tr><td>Decimal, or base 10<\/td><td>0\u20139<\/td><td>1, 10, 100, 1,000<\/td><td>5<\/td><\/tr><tr><td>Binary, or base 2<\/td><td>0 and 1<\/td><td>1, 2, 4, 8<\/td><td>101<\/td><\/tr><\/tbody><\/table>\n<p>The quantity stays the same. Five objects are still five objects, whether you write the number as 5 in decimal or 101 in binary.<\/p>\n<p>A small base label removes confusion: 101\u2082 means binary, while 5\u2081\u2080 means decimal. So 10\u2082 equals 2\u2081\u2080, not ten. Throughout this guide, an unlabelled ordinary number is decimal unless the surrounding text says otherwise.<\/p>\n<p>Three terms are worth keeping handy:<\/p>\n<ul><li><strong>Bit:<\/strong> one binary digit<\/li><li><strong>Byte:<\/strong> a group of eight bits<\/li><li><strong>Unsigned integer:<\/strong> a whole-number value that is zero or positive<\/li><\/ul>\n<p>A binary number doesn\u2019t have to contain eight bits. You can write five as 101\u2082 or, using an eight-bit field, 00000101\u2082. <a href=\"https:\/\/www.cs.cornell.edu\/courses\/cs3410\/2024fa\/notes\/numbers.html\" target=\"_blank\">Cornell\u2019s introduction to number representation<\/a> explains these place-value and storage distinctions.<\/p>\n<h2 id=\"how-binary-place-value-works\">How binary place value works<\/h2>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2026\/10\/kwebby-binary-place-values.webp\" alt=\"Binary place-value diagram showing 00101101 with the 32, 8, 4 and 1 columns highlighted, adding to decimal 45\" class=\"wp-image-24604\" width=\"1536\" height=\"1024\" loading=\"lazy\" style=\"width:100%;height:auto\" title=\"\" srcset=\"https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2026\/10\/kwebby-binary-place-values.webp 1536w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2026\/10\/kwebby-binary-place-values-300x200.webp 300w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2026\/10\/kwebby-binary-place-values-1024x683.webp 1024w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2026\/10\/kwebby-binary-place-values-768x512.webp 768w\" sizes=\"auto, (max-width: 1536px) 100vw, 1536px\" \/><figcaption>AI-generated explainer: the columns marked 1 contribute 32 + 8 + 4 + 1, so 00101101 in binary equals 45 in decimal.<\/figcaption><\/figure>\n<p>Start on the right with 1. Each move left doubles the value: 1, 2, 4, 8, 16, 32, 64, 128.<\/p>\n<p>A bit set to 1 includes its column in the total. A bit set to 0 leaves that column out.<\/p>\n<p>Here is the eight-bit pattern 00101101:<\/p>\n<table><thead><tr><th scope=\"col\">128<\/th><th scope=\"col\">64<\/th><th scope=\"col\">32<\/th><th scope=\"col\">16<\/th><th scope=\"col\">8<\/th><th scope=\"col\">4<\/th><th scope=\"col\">2<\/th><th scope=\"col\">1<\/th><\/tr><\/thead><tbody><tr><td>0<\/td><td>0<\/td><td>1<\/td><td>0<\/td><td>1<\/td><td>1<\/td><td>0<\/td><td>1<\/td><\/tr><\/tbody><\/table>\n<p>The rightmost column is the ones place. The columns marked 1 are 32, 8, 4, and 1.<\/p>\n<p><strong>00101101\u2082 = 32 + 8 + 4 + 1 = 45\u2081\u2080<\/strong><\/p>\n<p>You can drop the two leading zeroes and write 101101\u2082. For this unsigned value, nothing changes.<\/p>\n<p>If you know powers, these columns are 2\u2070, 2\u00b9, 2\u00b2, 2\u00b3, and so on. You don\u2019t need to memorise that notation yet. Doubling from 1 gets you the same chart.<\/p>\n<h2 id=\"how-to-count-in-binary\">How to count in binary<\/h2>\n<p>Binary begins 0, 1, 10, 11, 100. You create a new column sooner than in decimal because a column can hold only 0 or 1.<\/p>\n<p>When you add 1 to a column that already contains 1, write 0 and carry 1 into the next column. That carry may continue across several columns.<\/p>\n<p>Watch what happens around decimal seven:<\/p>\n<ul><li>110\u2082 is 6<\/li><li>111\u2082 is 7<\/li><li>1000\u2082 is 8<\/li><li>1001\u2082 is 9<\/li><\/ul>\n<p>The same pattern appears at fifteen: 1111\u2082 + 1\u2082 = 10000\u2082. All four existing columns reset to 0, and the carry creates a new leftmost 1.<\/p>\n<h3 id=\"binary-numbers-from-0-to-31\">Binary numbers from 0 to 31<\/h3>\n<p>This chart leaves out unnecessary leading zeroes. A new digit appears at decimal 2, 4, 8, and 16.<\/p>\n<table><thead><tr><th scope=\"col\">Decimal<\/th><th scope=\"col\">Binary<\/th><\/tr><\/thead><tbody><tr><td>0<\/td><td>0<\/td><\/tr><tr><td>1<\/td><td>1<\/td><\/tr><tr><td>2<\/td><td>10<\/td><\/tr><tr><td>3<\/td><td>11<\/td><\/tr><tr><td>4<\/td><td>100<\/td><\/tr><tr><td>5<\/td><td>101<\/td><\/tr><tr><td>6<\/td><td>110<\/td><\/tr><tr><td>7<\/td><td>111<\/td><\/tr><tr><td>8<\/td><td>1000<\/td><\/tr><tr><td>9<\/td><td>1001<\/td><\/tr><tr><td>10<\/td><td>1010<\/td><\/tr><tr><td>11<\/td><td>1011<\/td><\/tr><tr><td>12<\/td><td>1100<\/td><\/tr><tr><td>13<\/td><td>1101<\/td><\/tr><tr><td>14<\/td><td>1110<\/td><\/tr><tr><td>15<\/td><td>1111<\/td><\/tr><tr><td>16<\/td><td>10000<\/td><\/tr><tr><td>17<\/td><td>10001<\/td><\/tr><tr><td>18<\/td><td>10010<\/td><\/tr><tr><td>19<\/td><td>10011<\/td><\/tr><tr><td>20<\/td><td>10100<\/td><\/tr><tr><td>21<\/td><td>10101<\/td><\/tr><tr><td>22<\/td><td>10110<\/td><\/tr><tr><td>23<\/td><td>10111<\/td><\/tr><tr><td>24<\/td><td>11000<\/td><\/tr><tr><td>25<\/td><td>11001<\/td><\/tr><tr><td>26<\/td><td>11010<\/td><\/tr><tr><td>27<\/td><td>11011<\/td><\/tr><tr><td>28<\/td><td>11100<\/td><\/tr><tr><td>29<\/td><td>11101<\/td><\/tr><tr><td>30<\/td><td>11110<\/td><\/tr><tr><td>31<\/td><td>11111<\/td><\/tr><\/tbody><\/table>\n<p>Four larger boundaries follow the same rule:<\/p>\n<table><thead><tr><th scope=\"col\">Decimal<\/th><th scope=\"col\">Binary<\/th><\/tr><\/thead><tbody><tr><td>127<\/td><td>1111111<\/td><\/tr><tr><td>128<\/td><td>10000000<\/td><\/tr><tr><td>255<\/td><td>11111111<\/td><\/tr><tr><td>256<\/td><td>100000000<\/td><\/tr><\/tbody><\/table>\n<p>Counting includes zero. That\u2019s why 32 different five-bit patterns cover the values 0\u201331, rather than 1\u201332.<\/p>\n<h2 id=\"how-to-convert-binary-to-decimal\">How to convert binary to decimal<\/h2>\n<p>I find it helpful to write the place values above the digits before doing any arithmetic.<\/p>\n<ol><li>Start at the rightmost digit and label its place 1<\/li><li>Moving left, label the remaining places 2, 4, 8, 16, and so on<\/li><li>Keep only the place values with a 1 beneath them<\/li><li>Add those values<\/li><\/ol>\n<p>For 101101\u2082, the full calculation is:<\/p>\n<p><strong>1 \u00d7 32 + 0 \u00d7 16 + 1 \u00d7 8 + 1 \u00d7 4 + 0 \u00d7 2 + 1 \u00d7 1 = 45<\/strong><\/p>\n<p>You can shorten that to 32 + 8 + 4 + 1 = 45 once the column positions are clear.<\/p>\n<p>Try a second number: 100101\u2082. Its 1s sit in the 32, 4, and 1 columns, so the answer is <strong>37<\/strong>.<\/p>\n<p>Now try 11010\u2082 yourself. The included places are 16, 8, and 2, giving <strong>26<\/strong>. The zero on the right contributes nothing, but it still holds the ones position. Don\u2019t skip zeroes when labelling the columns.<\/p>\n<h2 id=\"how-to-convert-decimal-to-binary\">How to convert decimal to binary<\/h2>\n<p>You have two useful methods. One builds the number from powers of two. The other repeatedly divides by two and records what is left over.<\/p>\n<h3 id=\"method-1-build-the-number-from-powers-of-two\">Method 1: Build the number from powers of two<\/h3>\n<p>Let\u2019s convert decimal 45.<\/p>\n<p>Choose the largest power of two that fits into 45, which is 32. Subtract it, then work down through every smaller place.<\/p>\n<table><thead><tr><th scope=\"col\">Place value<\/th><th scope=\"col\">What to do<\/th><th scope=\"col\">Bit<\/th><th scope=\"col\">Amount left<\/th><\/tr><\/thead><tbody><tr><td>32<\/td><td>Take 32 from 45<\/td><td>1<\/td><td>13<\/td><\/tr><tr><td>16<\/td><td>16 is too large<\/td><td>0<\/td><td>13<\/td><\/tr><tr><td>8<\/td><td>Take 8 from 13<\/td><td>1<\/td><td>5<\/td><\/tr><tr><td>4<\/td><td>Take 4 from 5<\/td><td>1<\/td><td>1<\/td><\/tr><tr><td>2<\/td><td>2 is too large<\/td><td>0<\/td><td>1<\/td><\/tr><tr><td>1<\/td><td>Take the remaining 1<\/td><td>1<\/td><td>0<\/td><\/tr><\/tbody><\/table>\n<p>Read the bit column from top to bottom: <strong>101101\u2082<\/strong>.<\/p>\n<p>Keep a 0 for every place you skip. Leaving out the 16 or 2 column would move the other digits into the wrong positions.<\/p>\n<h3 id=\"method-2-divide-by-two-and-keep-the-remainders\">Method 2: Divide by two and keep the remainders<\/h3>\n<p>Divide the whole number by 2. Record the whole-number quotient and remainder, then divide the quotient again. Stop when the quotient reaches zero.<\/p>\n<table><thead><tr><th scope=\"col\">Division<\/th><th scope=\"col\">Whole-number quotient<\/th><th scope=\"col\">Remainder<\/th><\/tr><\/thead><tbody><tr><td>45 \u00f7 2<\/td><td>22<\/td><td>1<\/td><\/tr><tr><td>22 \u00f7 2<\/td><td>11<\/td><td>0<\/td><\/tr><tr><td>11 \u00f7 2<\/td><td>5<\/td><td>1<\/td><\/tr><tr><td>5 \u00f7 2<\/td><td>2<\/td><td>1<\/td><\/tr><tr><td>2 \u00f7 2<\/td><td>1<\/td><td>0<\/td><\/tr><tr><td>1 \u00f7 2<\/td><td>0<\/td><td>1<\/td><\/tr><\/tbody><\/table>\n<p><strong>Read the remainders from bottom to top: 101101.<\/strong><\/p>\n<p>The first remainder belongs to the rightmost, or ones, place. That\u2019s why reading downward gives the wrong order. <a href=\"https:\/\/www.cs.cornell.edu\/courses\/cs3410\/2013sp\/lecture\/03-numbers-and-arithmetic-i.pdf\" target=\"_blank\">Cornell\u2019s number-system lesson<\/a> covers this repeated-division method.<\/p>\n<p>Zero is a simple special case: decimal 0 is binary 0.<\/p>\n<p>Whichever method you choose, check the answer by adding its place values. Here, 32 + 8 + 4 + 1 returns the original 45.<\/p>\n<h2 id=\"binary-addition-with-a-carry-example\">Binary addition, with a carry example<\/h2>\n<p>Binary addition uses four basic rules:<\/p>\n<ul><li>0 + 0 = 0<\/li><li>0 + 1 = 1<\/li><li>1 + 0 = 1<\/li><li>1 + 1 = 10\u2082: write 0 and carry 1<\/li><\/ul>\n<p>A column can also receive a carry from its neighbour. Then 1 + 1 + 1 = 11\u2082: write 1 and carry 1.<\/p>\n<p>Let\u2019s add <strong>1101\u2082 + 1011\u2082<\/strong>. Work from right to left:<\/p>\n<ol><li>Ones: 1 + 1 = 10\u2082. Write 0 and carry 1<\/li><li>Twos: 0 + 1 + the carry = 10\u2082. Write 0 and carry 1<\/li><li>Fours: 1 + 0 + the carry = 10\u2082. Write 0 and carry 1<\/li><li>Eights: 1 + 1 + the carry = 11\u2082. Write 1 and carry 1<\/li><li>Put the final carry in a new sixteens column<\/li><\/ol>\n<p>The result is <strong>11000\u2082<\/strong>. Check it in decimal: 13 + 11 = 24, and 16 + 8 = 24.<\/p>\n<p>This example lets the answer grow to five bits. A fixed four-bit storage field cannot hold unsigned 24; the available width matters when you\u2019re doing arithmetic in a program.<\/p>\n<h2 id=\"bits-bytes-and-the-biggest-number-you-can-store\">Bits, bytes and the biggest number you can store<\/h2>\n<p>There is no largest binary number if you can keep adding digits. A fixed number of bits, however, gives you a fixed number of patterns.<\/p>\n<p>For an unsigned integer with n bits:<\/p>\n<ul><li>Number of patterns: <strong>2\u207f<\/strong><\/li><li>Smallest value: <strong>0<\/strong><\/li><li>Largest value: <strong>2\u207f \u2212 1<\/strong><\/li><\/ul>\n<table><thead><tr><th scope=\"col\">Width<\/th><th scope=\"col\">Different patterns<\/th><th scope=\"col\">Unsigned range<\/th><\/tr><\/thead><tbody><tr><td>4 bits<\/td><td>16<\/td><td>0\u201315<\/td><\/tr><tr><td>8 bits<\/td><td>256<\/td><td>0\u2013255<\/td><\/tr><tr><td>16 bits<\/td><td>65,536<\/td><td>0\u201365,535<\/td><\/tr><\/tbody><\/table>\n<p>Zero uses one of the patterns, so the highest unsigned eight-bit value is 255, not 256. All eight bits are 1: 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255. <a href=\"https:\/\/www.phon.ox.ac.uk\/files\/lecture_1\/binary_numbers.htm\" target=\"_blank\">Oxford\u2019s binary-number teaching note<\/a> compares these widths and interpretations.<\/p>\n<h3 id=\"what-about-negative-numbers\">What about negative numbers?<\/h3>\n<p>The format tells you how to interpret the bits. A common signed format is <strong>two\u2019s complement<\/strong>.<\/p>\n<p>With eight-bit two\u2019s complement, the range is \u2212128 to 127. The pattern 11111111 means \u22121 in that format. Read the same eight bits as unsigned, and they mean 255.<\/p>\n<p>So a leading 1 doesn\u2019t always mean a negative number. You first need to know the width and the representation. <a href=\"https:\/\/www.cs.cornell.edu\/~tomf\/notes\/cps104\/twoscomp\" target=\"_blank\">Cornell\u2019s two\u2019s-complement notes<\/a> explain the signed rules in more detail.<\/p>\n<h2 id=\"how-binary-represents-text\">How binary represents text<\/h2>\n<p>Text needs a character encoding: a set of rules that connects characters to stored values.<\/p>\n<h3 id=\"text-to-binary-converter\">Text to binary converter<\/h3>\n\n<style>\n#kw-binary-converter-1 {box-sizing:border-box;width:100%;margin:1rem 0;padding:1.25rem;border:1px solid #d6dae1;border-radius:8px;background:#fff;color:#1f2937;text-align:left;}\n#kw-binary-converter-1 *, #kw-binary-converter-1 *::before, #kw-binary-converter-1 *::after {box-sizing:border-box;}\n#kw-binary-converter-1 .kwbc-title {margin:0 0 .5rem;font-weight:700;font-size:1.125rem;}\n#kw-binary-converter-1 .kwbc-help {margin:0 0 1rem;font-size:.9rem;line-height:1.5;}\n#kw-binary-converter-1 fieldset {display:flex;flex-wrap:wrap;gap:.5rem 1.25rem;margin:0 0 1rem;padding:0;border:0;}\n#kw-binary-converter-1 legend {margin-bottom:.5rem;font-weight:600;}\n#kw-binary-converter-1 .kwbc-choice {display:inline-flex;align-items:center;gap:.4rem;cursor:pointer;}\n#kw-binary-converter-1 input[type=\"radio\"] {margin:0;accent-color:#0065d1;}\n#kw-binary-converter-1 .kwbc-label {display:block;margin:0 0 .4rem;font-weight:600;}\n#kw-binary-converter-1 textarea {display:block;width:100%;min-height:112px;margin:0 0 1rem;padding:.75rem;border:1px solid #8e98a8;border-radius:4px;background:#fff;color:#1f2937;font:inherit;resize:vertical;}\n#kw-binary-converter-1 button {min-height:44px;padding:.55rem 1rem;border:0;border-radius:4px;background:#0065d1;color:#fff;font:inherit;font-weight:600;cursor:pointer;}\n#kw-binary-converter-1 button:hover {background:#004c9e;}\n#kw-binary-converter-1 button:focus-visible, #kw-binary-converter-1 textarea:focus-visible, #kw-binary-converter-1 input:focus-visible {outline:3px solid #1f2937;outline-offset:3px;}\n#kw-binary-converter-1 .kwbc-error {margin:1rem 0 0;color:#b42318;font-weight:600;}\n#kw-binary-converter-1 .kwbc-result-label {margin:1rem 0 .4rem;font-weight:600;}\n#kw-binary-converter-1 .kwbc-result {display:block;min-height:52px;max-height:320px;margin:0;padding:.75rem;border-radius:4px;background:#f0f2f6;color:#1f2937;font:inherit;white-space:pre-wrap;overflow-wrap:anywhere;overflow:auto;}\n<\/style>\n<section id=\"kw-binary-converter-1\" aria-label=\"Text to binary converter widget\">\n  <p class=\"kwbc-title\">Text\u2013Binary Translator<\/p>\n  <p id=\"kw-binary-converter-1-help\" class=\"kwbc-help\">Uses UTF-8, including accented letters and emoji. Binary input must contain complete 8-bit bytes, either together or separated by spaces, tabs or new lines.<\/p>\n  <form novalidate>\n    <fieldset>\n      <legend>Conversion direction<\/legend>\n      <label class=\"kwbc-choice\" for=\"kw-binary-converter-1-encode\"><input type=\"radio\" name=\"kw-binary-converter-1-mode\" id=\"kw-binary-converter-1-encode\" value=\"encode\" checked> Text to Binary<\/label>\n      <label class=\"kwbc-choice\" for=\"kw-binary-converter-1-decode\"><input type=\"radio\" name=\"kw-binary-converter-1-mode\" id=\"kw-binary-converter-1-decode\" value=\"decode\" > Binary to Text<\/label>\n    <\/fieldset>\n    <label class=\"kwbc-label\" for=\"kw-binary-converter-1-input\">Text to convert<\/label>\n    <textarea id=\"kw-binary-converter-1-input\" aria-describedby=\"kw-binary-converter-1-help kw-binary-converter-1-error\" placeholder=\"Enter text, for example Hello!\" spellcheck=\"false\"><\/textarea>\n    <button type=\"submit\">Convert<\/button>\n    <p id=\"kw-binary-converter-1-error\" class=\"kwbc-error\" role=\"alert\" hidden><\/p>\n    <p class=\"kwbc-result-label\">Result<\/p>\n    <output class=\"kwbc-result\" for=\"kw-binary-converter-1-input\" aria-live=\"polite\" aria-atomic=\"true\"><\/output>\n  <\/form>\n<\/section>\n<script>\n(function () {\n  'use strict';\n  const root = document.getElementById('kw-binary-converter-1');\n  if (!root || root.dataset.initialized === 'true') return;\n  root.dataset.initialized = 'true';\n  const form = root.querySelector('form');\n  const input = root.querySelector('textarea');\n  const inputLabel = root.querySelector('.kwbc-label');\n  const encodeMode = root.querySelector('input[value=\"encode\"]');\n  const output = root.querySelector('output');\n  const error = root.querySelector('.kwbc-error');\n  function clearResult() {\n    output.textContent = '';\n    error.textContent = '';\n    error.hidden = true;\n    input.removeAttribute('aria-invalid');\n  }\n  function showError(message) {\n    error.textContent = message;\n    error.hidden = false;\n    input.setAttribute('aria-invalid', 'true');\n  }\n  form.addEventListener('change', function (event) {\n    if (event.target.type !== 'radio') return;\n    clearResult();\n    inputLabel.textContent = encodeMode.checked ? 'Text to convert' : 'Binary to convert';\n    input.placeholder = encodeMode.checked ? 'Enter text, for example Hello!' : 'Enter binary, for example 01001000 01101001';\n  });\n  input.addEventListener('input', clearResult);\n  form.addEventListener('submit', function (event) {\n    event.preventDefault();\n    clearResult();\n    const value = input.value;\n    if (encodeMode.checked) {\n      if (value.length === 0) {\n        showError('Enter some text to convert.');\n        return;\n      }\n      output.textContent = Array.from(new TextEncoder().encode(value), function (byte) {\n        return byte.toString(2).padStart(8, '0');\n      }).join(' ');\n      return;\n    }\n    const binary = value.trim();\n    if (!binary) {\n      showError('Enter some binary to convert.');\n      return;\n    }\n    if (!\/^[01\\s]+$\/.test(binary)) {\n      showError('Use only 0 and 1, with optional whitespace between bytes.');\n      return;\n    }\n    const groups = binary.split(\/\\s+\/);\n    if (groups.some(function (group) { return group.length % 8 !== 0; })) {\n      showError('Each byte must contain exactly 8 bits. Keep spaces, tabs and new lines between complete bytes.');\n      return;\n    }\n    const bits = groups.join('');\n    const bytes = new Uint8Array(bits.length \/ 8);\n    for (let i = 0; i < bytes.length; i++) {\n      bytes[i] = parseInt(bits.slice(i * 8, i * 8 + 8), 2);\n    }\n    try {\n      output.textContent = new TextDecoder('utf-8', {fatal:true, ignoreBOM:true}).decode(bytes);\n    } catch (exception) {\n      showError('These bytes are not valid UTF-8 text. Check the binary input and its encoding.');\n    }\n  });\n}());\n<\/script>\n\n<p>For example, capital <strong>A<\/strong> has ASCII value <strong>65<\/strong>. Written in an eight-bit byte, that value is <strong>01000001<\/strong>.<\/p>\n<p>RFC 20 calls ASCII \u201cstandard 7-bit ASCII\u201d and describes placing it in an eight-bit byte with a leading zero. That distinction matters: ASCII itself is a seven-bit code. <a href=\"https:\/\/www.rfc-editor.org\/rfc\/rfc20.html\" target=\"_blank\">Read the ASCII specification<\/a>.<\/p>\n<p>Using that byte notation, <strong>Hello!<\/strong> becomes:<\/p>\n<p><strong>01001000 01100101 01101100 01101100 01101111 00100001<\/strong><\/p>\n<p>The spaces separate bytes for readability. They aren\u2019t addition signs, and they don\u2019t represent extra spaces in the original text.<\/p>\n<p>Also watch the difference between a number and a written digit. The integer 5 can be written as 101\u2082. The text character \u201c5\u201d has ASCII value 53, or 00110101 in an eight-bit byte.<\/p>\n<p>For text beyond ASCII, UTF-8 is a common encoding. It uses one to four bytes per Unicode scalar value. For example, <strong>\u00e9<\/strong> written as the single Unicode character U+00E9 becomes the two UTF-8 bytes <strong>11000011 10101001<\/strong>. Some visible symbols contain multiple code points, so \u201cone symbol equals one byte\u201d isn\u2019t a safe rule. <a href=\"https:\/\/www.rfc-editor.org\/rfc\/rfc3629.html\" target=\"_blank\">RFC 3629 defines UTF-8<\/a>.<\/p>\n<p>A string of bits only becomes meaningful text when you know how it was encoded. Encoding also isn\u2019t encryption: changing text into binary digits doesn\u2019t make it secret.<\/p>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2026\/10\/kwebby-binary-converter-fresh-screenshot.webp\" alt=\"Fresh screenshot of Kwebby Text-Binary Translator with Text to Binary selected, input A and result 01000001\" class=\"wp-image-24622\" width=\"828\" height=\"551\" loading=\"lazy\" style=\"width:100%;height:auto\" title=\"\" srcset=\"https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2026\/10\/kwebby-binary-converter-fresh-screenshot.webp 828w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2026\/10\/kwebby-binary-converter-fresh-screenshot-300x200.webp 300w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2026\/10\/kwebby-binary-converter-fresh-screenshot-768x511.webp 768w\" sizes=\"auto, (max-width: 828px) 100vw, 828px\" \/><figcaption>Actual Kwebby converter screenshot, captured 4 October 2026: 1. Select Text to Binary. 2. Enter A and click Convert. 3. Read the result, 01000001.<\/figcaption><\/figure>\n<h3 id=\"binary-to-text-converter\">Binary to text converter<\/h3>\n\n<style>\n#kw-binary-converter-2 {box-sizing:border-box;width:100%;margin:1rem 0;padding:1.25rem;border:1px solid #d6dae1;border-radius:8px;background:#fff;color:#1f2937;text-align:left;}\n#kw-binary-converter-2 *, #kw-binary-converter-2 *::before, #kw-binary-converter-2 *::after {box-sizing:border-box;}\n#kw-binary-converter-2 .kwbc-title {margin:0 0 .5rem;font-weight:700;font-size:1.125rem;}\n#kw-binary-converter-2 .kwbc-help {margin:0 0 1rem;font-size:.9rem;line-height:1.5;}\n#kw-binary-converter-2 fieldset {display:flex;flex-wrap:wrap;gap:.5rem 1.25rem;margin:0 0 1rem;padding:0;border:0;}\n#kw-binary-converter-2 legend {margin-bottom:.5rem;font-weight:600;}\n#kw-binary-converter-2 .kwbc-choice {display:inline-flex;align-items:center;gap:.4rem;cursor:pointer;}\n#kw-binary-converter-2 input[type=\"radio\"] {margin:0;accent-color:#0065d1;}\n#kw-binary-converter-2 .kwbc-label {display:block;margin:0 0 .4rem;font-weight:600;}\n#kw-binary-converter-2 textarea {display:block;width:100%;min-height:112px;margin:0 0 1rem;padding:.75rem;border:1px solid #8e98a8;border-radius:4px;background:#fff;color:#1f2937;font:inherit;resize:vertical;}\n#kw-binary-converter-2 button {min-height:44px;padding:.55rem 1rem;border:0;border-radius:4px;background:#0065d1;color:#fff;font:inherit;font-weight:600;cursor:pointer;}\n#kw-binary-converter-2 button:hover {background:#004c9e;}\n#kw-binary-converter-2 button:focus-visible, #kw-binary-converter-2 textarea:focus-visible, #kw-binary-converter-2 input:focus-visible {outline:3px solid #1f2937;outline-offset:3px;}\n#kw-binary-converter-2 .kwbc-error {margin:1rem 0 0;color:#b42318;font-weight:600;}\n#kw-binary-converter-2 .kwbc-result-label {margin:1rem 0 .4rem;font-weight:600;}\n#kw-binary-converter-2 .kwbc-result {display:block;min-height:52px;max-height:320px;margin:0;padding:.75rem;border-radius:4px;background:#f0f2f6;color:#1f2937;font:inherit;white-space:pre-wrap;overflow-wrap:anywhere;overflow:auto;}\n<\/style>\n<section id=\"kw-binary-converter-2\" aria-label=\"Binary to text converter widget\">\n  <p class=\"kwbc-title\">Text\u2013Binary Translator<\/p>\n  <p id=\"kw-binary-converter-2-help\" class=\"kwbc-help\">Uses UTF-8, including accented letters and emoji. Binary input must contain complete 8-bit bytes, either together or separated by spaces, tabs or new lines.<\/p>\n  <form novalidate>\n    <fieldset>\n      <legend>Conversion direction<\/legend>\n      <label class=\"kwbc-choice\" for=\"kw-binary-converter-2-encode\"><input type=\"radio\" name=\"kw-binary-converter-2-mode\" id=\"kw-binary-converter-2-encode\" value=\"encode\" > Text to Binary<\/label>\n      <label class=\"kwbc-choice\" for=\"kw-binary-converter-2-decode\"><input type=\"radio\" name=\"kw-binary-converter-2-mode\" id=\"kw-binary-converter-2-decode\" value=\"decode\" checked> Binary to Text<\/label>\n    <\/fieldset>\n    <label class=\"kwbc-label\" for=\"kw-binary-converter-2-input\">Binary to convert<\/label>\n    <textarea id=\"kw-binary-converter-2-input\" aria-describedby=\"kw-binary-converter-2-help kw-binary-converter-2-error\" placeholder=\"Enter binary, for example 01001000 01101001\" spellcheck=\"false\"><\/textarea>\n    <button type=\"submit\">Convert<\/button>\n    <p id=\"kw-binary-converter-2-error\" class=\"kwbc-error\" role=\"alert\" hidden><\/p>\n    <p class=\"kwbc-result-label\">Result<\/p>\n    <output class=\"kwbc-result\" for=\"kw-binary-converter-2-input\" aria-live=\"polite\" aria-atomic=\"true\"><\/output>\n  <\/form>\n<\/section>\n<script>\n(function () {\n  'use strict';\n  const root = document.getElementById('kw-binary-converter-2');\n  if (!root || root.dataset.initialized === 'true') return;\n  root.dataset.initialized = 'true';\n  const form = root.querySelector('form');\n  const input = root.querySelector('textarea');\n  const inputLabel = root.querySelector('.kwbc-label');\n  const encodeMode = root.querySelector('input[value=\"encode\"]');\n  const output = root.querySelector('output');\n  const error = root.querySelector('.kwbc-error');\n  function clearResult() {\n    output.textContent = '';\n    error.textContent = '';\n    error.hidden = true;\n    input.removeAttribute('aria-invalid');\n  }\n  function showError(message) {\n    error.textContent = message;\n    error.hidden = false;\n    input.setAttribute('aria-invalid', 'true');\n  }\n  form.addEventListener('change', function (event) {\n    if (event.target.type !== 'radio') return;\n    clearResult();\n    inputLabel.textContent = encodeMode.checked ? 'Text to convert' : 'Binary to convert';\n    input.placeholder = encodeMode.checked ? 'Enter text, for example Hello!' : 'Enter binary, for example 01001000 01101001';\n  });\n  input.addEventListener('input', clearResult);\n  form.addEventListener('submit', function (event) {\n    event.preventDefault();\n    clearResult();\n    const value = input.value;\n    if (encodeMode.checked) {\n      if (value.length === 0) {\n        showError('Enter some text to convert.');\n        return;\n      }\n      output.textContent = Array.from(new TextEncoder().encode(value), function (byte) {\n        return byte.toString(2).padStart(8, '0');\n      }).join(' ');\n      return;\n    }\n    const binary = value.trim();\n    if (!binary) {\n      showError('Enter some binary to convert.');\n      return;\n    }\n    if (!\/^[01\\s]+$\/.test(binary)) {\n      showError('Use only 0 and 1, with optional whitespace between bytes.');\n      return;\n    }\n    const groups = binary.split(\/\\s+\/);\n    if (groups.some(function (group) { return group.length % 8 !== 0; })) {\n      showError('Each byte must contain exactly 8 bits. Keep spaces, tabs and new lines between complete bytes.');\n      return;\n    }\n    const bits = groups.join('');\n    const bytes = new Uint8Array(bits.length \/ 8);\n    for (let i = 0; i < bytes.length; i++) {\n      bytes[i] = parseInt(bits.slice(i * 8, i * 8 + 8), 2);\n    }\n    try {\n      output.textContent = new TextDecoder('utf-8', {fatal:true, ignoreBOM:true}).decode(bytes);\n    } catch (exception) {\n      showError('These bytes are not valid UTF-8 text. Check the binary input and its encoding.');\n    }\n  });\n}());\n<\/script>\n\n<p>The worked examples above state their encoding explicitly and can be followed independently of the conversion widgets.<\/p>\n<h2 id=\"why-computers-use-binary\">Why computers use binary<\/h2>\n<p>Electronic circuits can distinguish physical states, such as different voltage levels. We use 0 and 1 to describe two logical states, then combine bits to represent more information. The exact physical implementation depends on the hardware. <a href=\"https:\/\/www.csunplugged.org\/en\/topics\/binary-numbers\/whats-it-all-about\/\" target=\"_blank\">CS Unplugged explains the underlying idea<\/a>.<\/p>\n<p>The format gives those bits meaning:<\/p>\n<ul><li>A numeric format can interpret them as a quantity<\/li><li>A character encoding can interpret them as text<\/li><li>An image format can use them to represent colour information<\/li><\/ul>\n<p>Thinking of a bit as a switch is a useful starting point. Just remember that the printed 0s and 1s describe stored information; they aren\u2019t tiny written digits inside the computer.<\/p>\n<h2 id=\"try-these-binary-practice-questions\">Try these binary practice questions<\/h2>\n<p>Try first, then check the answers below. A place-value row of 32, 16, 8, 4, 2, 1 is enough for the conversion questions.<\/p>\n<ol><li>Convert 11010\u2082 to decimal<\/li><li>Convert decimal 19 to binary<\/li><li>What comes immediately after 1111\u2082?<\/li><li>Add 101\u2082 and 11\u2082<\/li><li>What is the largest unsigned eight-bit integer?<\/li><li>Do 00101\u2082 and 101\u2082 have the same unsigned value?<\/li><\/ol>\n<h3 id=\"answers-and-explanations\">Answers and explanations<\/h3>\n<ol><li><strong>26.<\/strong> Add 16 + 8 + 2<\/li><li><strong>10011\u2082.<\/strong> The included places are 16, 2, and 1<\/li><li><strong>10000\u2082.<\/strong> The carry moves decimal 15 to decimal 16<\/li><li><strong>1000\u2082.<\/strong> In decimal, the calculation is 5 + 3 = 8<\/li><li><strong>255.<\/strong> All eight bits are 1; there are 256 values when zero is included<\/li><li><strong>Yes, both equal 5.<\/strong> Leading zeroes don\u2019t change an unsigned whole-number value<\/li><\/ol>\n<p>If an answer doesn\u2019t match, check column positions first. Then check carries or, for repeated division, the direction you read the remainders.<\/p>\n<h2 id=\"frequently-asked-questions\">Frequently asked questions<\/h2>\n<h3 id=\"is-1010-binary-or-decimal\">Is 1010 binary or decimal?<\/h3>\n<p>It can be either. In base 2, 1010\u2082 means decimal 10. In base 10, 1010 means one thousand and ten. A base label or clear context tells you which reading to use.<\/p>\n<h3 id=\"what-does-11111111-mean\">What does 11111111 mean?<\/h3>\n<p>As an unsigned eight-bit integer, it means 255. In eight-bit two\u2019s complement, it means \u22121. Other formats can assign the same bits other meanings.<\/p>\n<h3 id=\"can-binary-numbers-have-a-fractional-part\">Can binary numbers have a fractional part?<\/h3>\n<p>Yes. The places after the binary point are 1\/2, 1\/4, 1\/8, and so on. For example, 101.01\u2082 is 4 + 1 + 1\/4, or 5.25 in decimal. <a href=\"https:\/\/www.cs.cornell.edu\/~tomf\/notes\/cps104\/floating\" target=\"_blank\">Cornell\u2019s binary-fraction notes<\/a> explain this extension of place value.<\/p>\n<h3 id=\"does-a-leading-zero-change-a-binary-number\">Does a leading zero change a binary number?<\/h3>\n<p>For unsigned whole numbers, no. Both 101\u2082 and 00101\u2082 equal 5. When working with a stored format, also check its required width and interpretation.<\/p>\n<h3 id=\"how-do-i-explain-binary-to-a-child\">How do I explain binary to a child?<\/h3>\n<p>Make four cards labelled 8, 4, 2, and 1, with 1 on the right. Show a card to include its value and turn it over to leave it out. Showing 4 and 2 makes 6. Write a 1 for each visible card and a 0 for each hidden card: 0110\u2082.<\/p>\n<h3 id=\"is-binary-code-a-programming-language\">Is binary code a programming language?<\/h3>\n<p>Binary is a way to represent information. A sequence of bits could encode a number, a text character, or a machine instruction. Its format and context tell you how to read it.<\/p>\n<h2 id=\"final-thoughts\">Final thoughts<\/h2>\n<p>Start with the place values: 1, 2, 4, 8, and so on. Once you can identify the columns marked 1, converting a binary whole number becomes an addition problem.<\/p>\n<p>Try converting 19 to binary, then convert your answer back. That round trip gives you a simple way to catch mistakes without relying on a tool.<\/p>\n<p>If you want to put the same idea into code, see how to <a href=\"https:\/\/kwebby.com\/blog\/convert-a-number-into-binary-in-python\/\">convert a number to binary in Python<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>Binary is a way to write numbers using only 0 and 1. Each digit gets its value from its position. For example, 101 in binary&hellip;<\/p>\n","protected":false},"author":5,"featured_media":23818,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[100],"tags":[],"class_list":["post-23812","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog"],"_links":{"self":[{"href":"https:\/\/kwebby.com\/blog\/wp-json\/wp\/v2\/posts\/23812","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kwebby.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kwebby.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kwebby.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/kwebby.com\/blog\/wp-json\/wp\/v2\/comments?post=23812"}],"version-history":[{"count":4,"href":"https:\/\/kwebby.com\/blog\/wp-json\/wp\/v2\/posts\/23812\/revisions"}],"predecessor-version":[{"id":24624,"href":"https:\/\/kwebby.com\/blog\/wp-json\/wp\/v2\/posts\/23812\/revisions\/24624"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kwebby.com\/blog\/wp-json\/wp\/v2\/media\/23818"}],"wp:attachment":[{"href":"https:\/\/kwebby.com\/blog\/wp-json\/wp\/v2\/media?parent=23812"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kwebby.com\/blog\/wp-json\/wp\/v2\/categories?post=23812"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kwebby.com\/blog\/wp-json\/wp\/v2\/tags?post=23812"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}