Base64 Encoder & Decoder

Encode or decode Base64 strings instantly — free and private

Instant results | 100% client-side
Mode

Size Comparison

Quick Reference

  • Encode converts text to Base64
  • Decode converts Base64 back to text
  • Output is ~33% larger than the input
  • Full UTF-8 support for all languages

Common Use Cases

  • Embedding images in CSS/HTML
  • Email attachments (MIME)
  • Data URIs and JSON payloads
  • JWT tokens and API auth

100% Private

All encoding and decoding happens locally in your browser. No data is ever sent to any server.

What Is Base64 Encoding?

Understanding the encoding scheme that safely transports binary data through text channels

Base64 is a binary-to-text encoding scheme that converts binary data into a sequence of printable ASCII characters. It uses a set of 64 characters — uppercase letters (A–Z), lowercase letters (a–z), digits (0–9), plus (+), and slash (/) — to represent data. The equals sign (=) is used for padding.

Base64 encoding works by taking every 3 bytes (24 bits) of input and splitting them into 4 groups of 6 bits each. Each 6-bit group maps to one of the 64 characters. When the input length is not a multiple of 3, padding characters are appended to complete the final 4-character block.

Email & MIME

Email protocols like SMTP only support 7-bit ASCII. Base64 encodes binary attachments (images, PDFs, archives) into safe ASCII text so they can travel through email systems without corruption.

Web Development

Data URIs use Base64 to embed images, fonts, and other assets directly in HTML, CSS, or JavaScript. This reduces HTTP requests and can improve performance for small assets.

APIs & Tokens

JSON Web Tokens (JWT), HTTP Basic Authentication, and many API payloads use Base64 encoding to embed structured data in headers and URLs without special character conflicts.

Base64 Character Set Reference

The 64 characters used in standard Base64 encoding (RFC 4648)

Index Range Characters Description
0 – 25 A B C D ... X Y Z Uppercase Latin letters
26 – 51 a b c d ... x y z Lowercase Latin letters
52 – 61 0 1 2 3 4 5 6 7 8 9 Digits
62 + Plus sign (or - in URL-safe variant)
63 / Forward slash (or _ in URL-safe variant)
Pad = Padding character (0–2 appended to output)

URL-safe variant: In URL-safe Base64 (Base64url), the + character is replaced with - and / is replaced with _ to avoid conflicts in URLs and filenames.

Frequently Asked Questions

Common questions about Base64 encoding and decoding

Base64 encoding is used to represent binary data as ASCII text. Common applications include embedding images in HTML/CSS via data URIs, encoding email attachments (MIME), transmitting binary data in JSON or XML payloads, encoding JWT tokens, and HTTP Basic Authentication headers.
No. Base64 is not encryption and provides no security. It is a reversible encoding scheme designed for data transport, not data protection. Anyone can decode a Base64 string back to the original data without any key or password. Never use Base64 alone to protect sensitive information.
Base64 converts every 3 bytes of input into 4 ASCII characters (each representing 6 bits). This means the encoded output is always approximately 33% larger than the original data. For example, a 3 KB image becomes about 4 KB when Base64 encoded.
This tool will display an error message indicating that the input is not valid Base64. Invalid Base64 strings contain characters outside the Base64 alphabet or have incorrect padding. The tool validates the input before attempting to decode.
Yes. This tool uses the TextEncoder and TextDecoder APIs to properly handle UTF-8 multi-byte characters before encoding. This means emojis, accented characters, Chinese/Japanese/Korean text, and other non-ASCII characters are encoded and decoded correctly.