Happy Thanksgiving from the Portal. The Gathering, a harvest cipher maze, is free to play until 30 November. Enter The Gathering

Base64 Tool

Universal Encoder & Decoder

πŸ” TEXT & FILES

About This Tool

Encode and decode data using Base64 encoding. Convert text, files, images, and binary data to and from Base64 format. Perfect for data transmission, embedding images in HTML/CSS, API authentication, and cryptographic operations.

Perfect For:

  • Data Transmission: Safely transmit binary data over text protocols
  • Image Embedding: Convert images to data URLs for HTML/CSS
  • API Authentication: Encode credentials for Basic Auth
  • Puzzles & CTFs: Decode Base64 challenges and hidden messages
0 characters | 0 bytes

πŸ“ File Encode/Decode

Upload any file to encode to Base64, or upload a Base64 text file to decode back to its original format.

No file selected

βš™οΈ Encoding Options

0 characters | 0 bytes | 0% size change

πŸ” Base64 Validator

Ready to validate...

Base64 Character Set

Uppercase (A-Z)

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Values: 0-25

Lowercase (a-z)

a b c d e f g h i j k l m n o p q r s t u v w x y z
Values: 26-51

Numbers (0-9)

0 1 2 3 4 5 6 7 8 9
Values: 52-61

Special Characters

+ (plus) / (slash) = (padding)
Values: 62, 63, padding

URL-Safe Variant

- (minus) _ (underscore)
Replaces + and /

What is Base64 Encoding?

Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format. It encodes data using 64 printable characters (A-Z, a-z, 0-9, +, /) making it safe for transmission over text-based protocols.

How It Works

Base64 encoding converts binary data (8-bit bytes) into groups of 6 bits, then maps each 6-bit group to one of 64 printable characters:

  • Input: Binary data split into 24-bit groups (3 bytes)
  • Process: Each 24-bit group split into four 6-bit groups
  • Output: Each 6-bit group mapped to a Base64 character
  • Padding: '=' characters added if input isn't divisible by 3
  • Example: "Hello" β†’ "SGVsbG8=" (5 bytes β†’ 8 characters)

Common Use Cases

Base64 encoding is widely used in modern computing:

  • Email (MIME): Encoding attachments for safe transmission
  • Data URLs: Embedding images directly in HTML/CSS
  • Basic Authentication: HTTP Basic Auth encodes credentials
  • JSON/XML: Embedding binary data in text formats
  • Cryptography: Encoding keys, certificates, and encrypted data
  • URL Parameters: Safely passing binary data in URLs

Standard vs URL-Safe Base64

There are two main Base64 variants:

  • Standard (RFC 4648): Uses +, /, and = characters
  • URL-Safe (RFC 4648 Β§5): Uses -, _, and no padding

URL-safe Base64 replaces + with - and / with _ to prevent issues when encoding data for URLs, where + and / have special meanings.

Size Overhead

Base64 encoding increases data size by approximately 33%:

  • Every 3 bytes of input β†’ 4 bytes of output
  • 1000 bytes of binary β†’ ~1333 bytes of Base64
  • Padding characters may add 1-2 extra bytes

Encoding Process Example

Let's encode "Hi!" step by step:

1. Convert to Binary:
H = 01001000 (72)
i = 01101001 (105)
! = 00100001 (33)
2. Combine into 24-bit group:
010010 000110 100100 100001
3. Map to Base64 characters:
010010 = S (18)
000110 = G (6)
100100 = k (36)
100001 = h (33)
Result: SGkh

Security Note

Important: Base64 is an encoding method, not encryption. It does not provide any security or privacy. Anyone can decode Base64 data instantly. Never use Base64 alone to protect sensitive information!

Frequently Asked Questions

Is Base64 encoding secure?

No! Base64 is NOT encryption or security. It's simply an encoding format that makes binary data readable as text. Anyone can decode Base64 instantly. Use proper encryption (AES, RSA) for security.

Why does Base64 make files bigger?

Base64 increases size by ~33% because it converts 8-bit bytes to 6-bit characters. Every 3 bytes becomes 4 characters, and padding adds extra bytes when needed.

What's the '=' padding character for?

The '=' character pads the output when input length isn't divisible by 3. It ensures the decoder knows where the actual data ends. You'll see 0, 1, or 2 '=' characters at the end of Base64 strings.

Can I encode images and files?

Yes! This tool can encode any file type to Base64. Images can be embedded in HTML as data URLs, and any file type can be Base64-encoded for transmission or storage.

What's URL-safe Base64?

URL-safe Base64 uses - and _ instead of + and / because those characters have special meanings in URLs. It's defined in RFC 4648 Β§5 and is perfect for encoding data in URL parameters or filenames.

Is my data sent to a server?

No! All encoding and decoding happens locally in your browser using JavaScript. Your data never leaves your device, ensuring complete privacy.

Can I decode invalid Base64?

The tool will attempt to decode invalid Base64 but will show a warning. Invalid characters are ignored, and the validator will highlight issues to help you fix them.

Free educational tool - No registration required

Press F12 and type help() for console commands

Fun Fact: Base64 is called "Base64" because it uses 64 different characters to represent data!