SmartKitio

Developer topics · Updated 2026-10-04

Base64 Encoding Explained

Base64 represents binary data using 64 ASCII characters so the payload can travel through systems that expect text. It is an encoding for transport and embedding—not a way to hide secrets.

The mapping idea

Input bytes are read in groups of three (24 bits). Those bits become four 6-bit indices into the alphabet A–Z, a–z, 0–9, +, /. If the byte length is not a multiple of three, = padding characters complete the final quartet.

output length = 4 × ⌈byteLength ÷ 3⌉

What SmartKitio does

  • The Base64 Encoder converts text to UTF-8 bytes, then to standard Base64 with + / and = padding.
  • The Base64 Decoder strips whitespace first so wrapped email-style blocks still decode, then interprets bytes as UTF-8 text.
  • Encoding and decoding run in your browser.
  • URL-safe Base64 (− and _ without padding), as used inside many JWTs, is not produced by the standard encoder—swap alphabets if you need that variant.

Typical uses

  • Data URLs for small images (data:image/png;base64,…).
  • HTTP Basic authentication headers (credentials encoded, not encrypted).
  • Embedding binary fields inside JSON by agreement with the API.

Try these SmartKitio tools

Use a tool when you want a result; keep this guide open when you want the method.

Browse family: Developer Tools

Related articles

Broader reading that connects to this guide—when the topic deserves more than a how-to.

Related guides