RFC 4648 Compliant

Online Base64 Encoder & Decoder Tool

Encode text or files to Base64 and decode them back instantly. Supports UTF-8, URL-safe variant, line wrapping, and drag-and-drop file uploads. Everything stays in your browser.

Input — Plain text
file.bin
0 KB
Output — Base64
0 input bytes 0 output chars +0% size change 0 lines
Error Something went wrong.
Options
Live processing
Try an example

Text & Files

Encode any text, image, PDF, or binary up to 10 MB with drag-and-drop.

URL-Safe Variant

Switch to Base64URL for JWT, query strings, or filenames — no special characters.

Data URI Output

Generate data: URIs ready to drop into HTML or CSS.

100% Private

All conversion happens locally. Your text and files never leave your device.

What is Base64 Encoding?

Base64 is a binary-to-text encoding scheme defined by RFC 4648. It represents binary data as a string of 64 printable ASCII characters, making it safe to transmit through systems that only handle text — like email, JSON, XML, or URL parameters.

Every 3 bytes of binary data become exactly 4 Base64 characters, which means encoded output is roughly 33% larger than the original. The trailing = characters (padding) ensure the output length is always a multiple of 4.

Standard vs URL-safe Alphabet

The standard Base64 alphabet uses + and /, which conflict with URL syntax. The URL-safe variant (also called Base64URL) replaces them with - and _ — it's used in JSON Web Tokens (JWT), URL parameters, and S3 object keys.

Standard (RFC 4648 §4)
A–Z, a–z, 0–9, +, /   padding: =
URL-safe (RFC 4648 §5)
A–Z, a–z, 0–9, -, _   padding: optional

Common Use Cases

Embedding images directly in HTML/CSS via data: URIs, encoding email attachments (MIME), storing binary data in JSON or XML, transmitting files in API request bodies, JSON Web Tokens (JWT) where each part is Base64URL-encoded, basic HTTP authentication headers, and storing certificates and SSH keys in PEM format.

Important: Base64 is NOT encryption

Base64 is encoding, not encryption. Anyone can decode it without a key. Don't use it to "hide" passwords, secrets, or sensitive information — for that, use proper encryption like AES-256.

Copied!