Base64 encoding size calculator

Base64 packs three bytes into four characters, so it costs exactly a third more, plus padding.

Base64 size
133 336B
= Exact Base64 size
Base64 overhead
33.336 %
Hex size
200 000
Base32 size
160 000
Approximate data URI length
133 366
Rough gzipped size
100 002
Show the working
  1. Binary size = 100
  2. raw = 100 * 1000 = 100 000
  3. Base64 size = ceil(100 000 / 3) * 4 = 133 336
  4. Hex size = 100 000 * 2 = 200 000
  5. Base32 size = ceil(100 000 / 5) * 8 = 160 000
  6. Base64 overhead = 100 000 > 0 ? (133 336/100 000 - 1) * 100 : 0 = 33.336
  7. Approximate data URI length = 133 336 + 30 = 133 366
  8. Rough gzipped size = 133 336 * 0.75 = 100 002

Values are shown to six significant figures here; the arithmetic itself runs on exact fractions and is only rounded where a number is printed.

Scenarios & local history

Compare a saved scenario

Recent calculations

    The formula

    • Base64: ceil(n/3) x 4 characters
    • hex: 2n characters
    • Base32: ceil(n/5) x 8 characters

    Base64 overhead is exactly 33.3% before padding. Gzip recovers some of it, because Base64 output is highly redundant.

    Related calculators

    Settings

    Theme

    System follows your operating system and changes with it.

    Text size
    High contrast

    Maximises text and border contrast and removes the grid background.

    Graph-paper background

    Round to
    Notation
    Thousands separators
    Decimal mark
    Nearest fraction

    Shows the result as the nearest tape-measure fraction, with the error it costs.


    Accessibility & interaction
    Reduce motion Stops interface animations even when the operating system does not.
    Underline links Keeps links visually distinct without relying on colour.
    Larger touch targets Makes buttons and form controls easier to tap.
    Shorter reading lines Limits article width for easier scanning.
    Monochrome display Removes colour as an information cue.
    Always-visible focus Makes the keyboard focus ring persistent and stronger.
    Verbose screen-reader results Announces the complete conversion equation.
    Sticky action bars Keeps converter and calculator actions within reach.
    Select values on focus Replaces a value immediately when you start typing.
    Left-handed mobile layout Moves key mobile actions toward the left thumb.

    Your data

    Settings, recent conversions and favourites live in this browser only. Nothing is sent anywhere.

    Offline library