Base64 Encoder/Decoder

Encode text or files to Base64 format and decode Base64 strings back to original content instantly.

100% client-side No signup Free forever
// reference

About Base64

Base64 is a binary-to-text encoding scheme that represents binary data in ASCII string format. It's commonly used for:

  • Embedding images in HTML/CSS (data URIs)
  • Encoding email attachments (MIME)
  • Storing complex data in JSON
  • Transmitting data over text-based protocols
// how to use

How to Use Base64 Encoder/Decoder

How to Use the Base64 Encoder/Decoder

  1. Select mode: Choose whether you want to Encode (text to Base64) or Decode (Base64 to text).
  2. Enter your input: Paste or type your text/Base64 string in the input area.
  3. Optional: Select variant: Choose standard Base64 or URL-safe encoding.
  4. View result: The converted output appears instantly in the output area.
  5. Copy output: Click the copy button to copy the result to your clipboard.

Encoding Example

Input: Hello, World!
Output: SGVsbG8sIFdvcmxkIQ==

Decoding Example

Input: SGVsbG8sIFdvcmxkIQ==
Output: Hello, World!

// features

Features

  • Encode text to Base64
  • Decode Base64 to text
  • URL-safe Base64 option
  • File to Base64 conversion
  • Real-time encoding/decoding
  • Handles Unicode and UTF-8
  • No size limits
  • MIME line-break option
  • One-click copy
  • Privacy focused - no server upload
  • Mobile-friendly interface
  • Free with no registration
// about

About Base64 Encoder/Decoder

Base64 encoding transforms binary data into ASCII text, enabling safe transmission through systems designed for text. Our converter handles both encoding and decoding for text strings and binary files, essential for web development, email, and API work.

How Base64 Works

Base64 represents binary data using 64 printable ASCII characters (A-Z, a-z, 0-9, +, /). Every three bytes of input become four Base64 characters, increasing size by approximately 33%. This overhead is acceptable when text-safe transmission is required.

Common Applications

  • Data URLs: Embed images directly in HTML/CSS without separate file requests
  • Email Attachments: MIME encoding uses Base64 for binary attachments
  • API Payloads: JSON APIs transmit binary data as Base64 strings
  • Basic Authentication: HTTP Basic Auth encodes credentials in Base64
  • Cryptographic Operations: Keys and signatures often use Base64 representation

URL-Safe Variant

Standard Base64 includes + and / characters that have special meaning in URLs. URL-safe Base64 substitutes - and _, avoiding encoding issues in query strings and paths. Our tool supports both variants for different contexts.

// faq

Frequently Asked Questions

What is Base64 encoding?
Base64 is a binary-to-text encoding scheme that converts binary data into ASCII characters. It uses 64 characters (A-Z, a-z, 0-9, +, /) to represent data. This allows binary data like images or files to be safely transmitted through text-only channels like email or embedded in JSON/XML.
Why would I need to encode data in Base64?
Common use cases include: embedding images directly in HTML/CSS (data URIs), sending binary data in JSON APIs, encoding file attachments in emails (MIME), encoding credentials for Basic HTTP authentication, and storing binary data in text-based formats or databases that don't support binary.
Does Base64 encrypt my data?
No, Base64 is not encryption - it's encoding. Anyone can decode Base64 instantly without a key. It's designed for data format conversion, not security. Never use Base64 to protect sensitive information. If you need security, use proper encryption (AES, etc.) before Base64 encoding.
Why does Base64 increase file size?
Base64 encoding increases data size by approximately 33%. Every 3 bytes of binary data become 4 Base64 characters (6 bits per character × 4 = 24 bits = 3 bytes). This overhead is the tradeoff for text compatibility. Consider this when embedding large images or files.
What is the difference between standard Base64 and URL-safe Base64?
Standard Base64 uses + and / characters which have special meaning in URLs. URL-safe Base64 (Base64URL) replaces these with - and _ respectively, and often omits padding (=). Use URL-safe Base64 when the encoded string will appear in URLs or filenames.
Can I encode images and files to Base64?
Yes! Our tool supports file uploads. Upload any file (images, PDFs, documents) and get the Base64 string. For images, you'll also get the complete data URI format (data:image/png;base64,...) ready to paste directly into HTML or CSS.