Skip to main content
L
Loopaloo
Buy Us a Coffee
All ToolsImage ProcessingAudio ProcessingVideo ProcessingDocument & TextPDF ToolsCSV & Data AnalysisConverters & EncodersWeb ToolsMath & ScienceGames
Guides & BlogAboutContact
Buy Us a Coffee
  1. Home
  2. Converters & Encoders
  3. Base64 Encoder/Decoder
Add to favorites

Loading tool...

You might also like

URL Encoder/Decoder

URL encode or decode text for safe use in URLs

JWT Decoder

Decode and inspect JSON Web Tokens (JWT). View header, payload, claims, expiration status, and signature without needing the secret key

Unix Timestamp Converter

Convert between Unix/Epoch timestamps and human-readable dates. Supports seconds and milliseconds with timezone information

About Base64 Encoder/Decoder

Encode text or files to Base64 format or decode Base64 strings back to their original form with our free Base64 Encoder Decoder. Base64 is an essential encoding scheme for embedding binary data in text-based formats, sending files through JSON APIs, and encoding email attachments for transmission. Whether you need to embed images directly in HTML/CSS, send binary data through APIs that only accept text, encode files for secure transmission, or debug API payloads containing Base64 content, this tool handles all scenarios seamlessly. All conversion happens locally in your browser using standard Base64 encoding, ensuring complete privacy with no data sent to external servers. The tool supports both text input for quick conversions and file uploads for handling binary data, making it invaluable for developers, system administrators, and anyone working with data encoding.

How to Use

  1. 1Paste text or Base64 string in the input area
  2. 2Select "Encode" or "Decode" mode
  3. 3View the result instantly
  4. 4Copy the output to clipboard
  5. 5Optionally upload files for binary encoding

Key Features

  • Text to Base64 encoding
  • Base64 to text decoding
  • File/binary encoding support
  • URL-safe Base64 variant
  • One-click copy to clipboard
  • Real-time conversion
  • UTF-8 text support

Common Use Cases

  • Embedding images in HTML/CSS

    Convert image files to Base64 to embed directly in HTML img tags or CSS background-image properties, eliminating separate image requests and simplifying asset management.

  • Sending binary data through JSON APIs

    Encode binary files to Base64 strings for inclusion in JSON payloads, allowing you to transmit any file format through APIs that only support text.

  • Encoding email attachments

    Encode attachments to Base64 format for inclusion in MIME multipart email messages, enabling email systems to handle binary files like images and documents.

  • Creating data URIs for instant loading

    Generate data URIs by Base64-encoding images and small files, allowing them to load instantly inline without additional HTTP requests.

  • Debugging API payloads

    Decode Base64-encoded responses from APIs to inspect the actual content and verify that binary data was transmitted correctly through text-based protocols.

  • Securing file uploads in forms

    Encode file contents to Base64 before sending through HTML forms or API requests that require text-only fields, preserving exact binary content.

Understanding the Concepts

Base64 is a binary-to-text encoding scheme that represents binary data using a set of 64 printable ASCII characters. The encoding was originally developed to solve a fundamental problem in computing: how to transmit binary data over channels that were designed to handle only text. Early email systems, for example, could only reliably transmit 7-bit ASCII characters, making it impossible to send images, executables, or other binary files without some form of encoding. Base64 emerged as the elegant solution to this challenge.

The algorithm works by taking three bytes (24 bits) of binary input and splitting them into four groups of six bits each. Each six-bit group maps to one of 64 characters in the Base64 alphabet, which consists of uppercase letters A–Z, lowercase letters a–z, digits 0–9, and two additional characters (typically + and /). When the input length is not a multiple of three bytes, padding characters (=) are appended to the output to signal the decoder how many bytes were in the final group. This three-to-four byte expansion is why Base64-encoded data is always approximately 33% larger than the original binary data.

The encoding scheme is formally defined in RFC 4648, published in 2006, though its origins trace back to the Privacy Enhanced Mail (PEM) specification in the early 1990s and even earlier to developments in MIME (Multipurpose Internet Mail Extensions). Over the decades, several variants have appeared. The standard Base64 alphabet uses + and / as the 63rd and 64th characters, but URL-safe Base64 replaces these with - and _ to avoid conflicts with URL-reserved characters. This variant is particularly important for web applications where encoded data appears in query strings, cookies, or URL path segments.

Today, Base64 encoding is ubiquitous across modern software development. Data URIs use Base64 to embed images, fonts, and other assets directly into HTML and CSS files, eliminating additional HTTP requests. JSON Web Tokens (JWTs) use Base64URL encoding for their header and payload sections. APIs frequently accept file uploads as Base64-encoded strings within JSON request bodies. Email protocols still rely on Base64 for MIME-encoded attachments. Even source maps, configuration files, and cryptographic certificates make extensive use of this encoding.

Despite its prevalence, a common misconception is that Base64 provides security or encryption. It does not. Base64 is a reversible encoding, not a cipher—anyone can decode a Base64 string in microseconds. Its sole purpose is format conversion: transforming binary data into a text-safe representation that can travel through text-only channels without corruption.

Frequently Asked Questions

Why does Base64 increase file size?

Base64 encoding increases size by approximately 33% because it represents 3 bytes of binary data as 4 ASCII characters.

Is Base64 encryption?

No. Base64 is encoding, not encryption. Anyone can decode Base64 - it provides no security, only format conversion.

Privacy First

All processing happens directly in your browser. Your files never leave your device and are never uploaded to any server.