Base64 Encoder/Decoder

Encode text to Base64 or decode Base64 strings to UTF-8 plaintext with URL-safe variants, instant payload metrics, and byte overhead breakdown.

Input Data

Processed Result
encoded Result

Mode

encode

Input Size

47 B

Output Size

0 B

Size Delta

+-100.0%

Important Security Disclaimer

Base64 is strictly data encoding, NOT encryption. Anyone can decode Base64 data without a private key. Never use Base64 to secure passwords or personal credentials.

RFC 4648 Mathematical Specification & Bit Expansion

Base64 partitions input byte streams into 6-bit slices (2⁶ = 64 combinations). Because 3 octets (3 × 8 = 24 bits) correspond exactly to 4 Base64 characters (4 × 6 = 24 bits), the resulting payload expands by 33.33%.

1. Encoded Output Length Formula
Output Length (bytes)=
4 × ⌈
N_input_bytes3
2. Theoretical Bandwidth Inflation
Inflation Ratio=
4 characters × 6 bits3 octets × 8 bits
=
43
≈ +33.33%
Step-by-Step Base64 Encoding Breakdown (Example: "Man")
Step 1: Convert ASCII Characters to 8-bit Binary Octets
'M' (77) = 01001101, 'a' (97) = 01100001, 'n' (110) = 01101110
Concatenated: [ 01001101 01100001 01101110 ] (24 bits)
Step 2: Partition into 4 Groups of 6 Bits
010011 (19) → 'T'
010110 (22) → 'W'
000101 (5) → 'F'
101110 (46) → 'u'
Step 3: Final Output Assembly
Encoded Base64 String=TWFu

Base64 vs URL-Safe Variant Reference

SpecificationIndex 62 CharacterIndex 63 CharacterPadding PolicyStandard Usage
RFC 4648 (Standard)+/Mandatory '='MIME email, Data URIs, XML payloads
RFC 4648 §5 (URL-Safe)-_Optional / OmittedJSON Web Tokens (JWT), Query params

Frequently Asked Questions

What is Base64 encoding and why is it used?
Base64 is a binary-to-text encoding scheme that translates raw 8-bit bytes into 6-bit index characters from a 64-character ASCII alphabet (A–Z, a–z, 0–9, +, /). It prevents data corruption across text-only communication channels like MIME email attachments, URLs, and JSON payloads.
Is Base64 a form of encryption?
No. Base64 is strictly a serialization format, not encryption. It contains zero cryptographic security and can be reversed by anyone in milliseconds without a secret key.
Why does Base64 output increase file size by 33%?
Base64 maps every 3 bytes (24 bits) into 4 characters (6 bits each). Because 4 characters are transmitted instead of 3, the payload experiences a mathematical (4/3) or +33.33% size expansion.
What is the difference between standard and URL-Safe Base64?
Standard Base64 uses `+` and `/`, which collide with URL reserved query characters. URL-safe Base64 (RFC 4648 §5) swaps `+` for `-` and `/` for `_`, omitting or retaining padding without percent-encoding.

Related Tools