title: Base64 length calculation?
body: <p><em>After reading the base64 <a href="http://en.wikipedia.org/wiki/Base64#Padding">wiki</a> ...</em></p>
  
  <p>I'm trying to figure out <em>how's</em> the formula  working : </p>
  
  <p>Given a string with length of <code>n</code> , the base64 length will be <img src="https://i.stack.imgur.com/DIqFI.png" alt="enter image description here"></p>
  
  <p>Which is  : <code>4*Math.Ceiling(((double)s.Length/3)))</code></p>
  
  <p>I already know that base64 length must be <code>%4==0</code> to allow the decoder know what was the original text length.</p>
  
  <p>The max number of padding for a sequence can be <code>=</code> or <code>==</code>.</p>
  
  <blockquote>
    <p>wiki :The number of output bytes per input byte is approximately 4 / 3 (33%
    overhead)</p>
  </blockquote>
  
  <p><strong>Question:</strong></p>
  
  <p><strong>How</strong> does the information above settle with the output length   <img src="https://i.stack.imgur.com/DIqFI.png" alt="enter image description here"> ?</p>