iGuideSmart

Base64 Encoder & Decoder

Encode and decode UTF-8 text, emojis, and URL-safe Base64URL strings locally in your browser using TextEncoder and Uint8Array.

Formula & Calculation Logic

Converts arbitrary UTF-8 byte streams via TextEncoder into printable 64-character ASCII alphabets with "=" padding (or unpadded Base64URL with "-" and "_").

Primary Formula

3 bytes (24 bits) → 4 Base64 sextets (6 bits each, A–Z a–z 0–9 + /)

Example: Encode "Hello!" to Base64

  1. 1
    Encode UTF-8 bytes
    [72, 101, 108, 108, 111, 33]
    6 bytes (48 bits)
  2. 2
    Group into 8 six-bit symbols
    Base64 alphabet lookup
    SGVsbG8h

Standard Base64 vs. Base64URL Differences

Alphabet differences defined in RFC 4648.

Showing 4 of 4 reference values
Comparison of standard Base64 and Base64URL alphabets
FeatureStandard Base64Base64URL (RFC 4648 §5)Common Usage
Index 62 Character+-Safe in URLs without %2B
Index 63 Character/_Safe in filenames & paths
Padding Character= (required)= (usually omitted)JWTs omit trailing =
Size Overhead+33.3%+33.3%4 chars per 3 bytes

Practical Real-World Use Cases

HTTP Basic Auth & Data URIs

Encode credentials or small inline SVG/CSS payloads safely.

JWT & Webhook Debugging

Decode Base64URL segments without padding errors.

Base64 Encoder & Decoder – Frequently Asked Questions

Why does Base64 increase payload size by ~33%?
Every 3 raw bytes (24 bits) expand into 4 ASCII characters (32 bits), a 4:3 (+33.3%) overhead.
Is Base64 encryption?
No. Base64 is a reversible encoding scheme for binary-safe transport, not encryption.
Does this support Unicode emojis and non-Latin text?
Yes—unlike naive window.btoa(), we encode through UTF-8 TextEncoder/TextDecoder.
View all Developer Tools →