Base64 Encoder & Decoder

Encode and decode Base64 online for free. Supports UTF-8, URL-safe mode, and file uploads. Instant results — no data sent to any server.

Input

0 characters

Output

How to Encode and Decode Base64 Online

  1. 1

    Choose your mode

    Select Encode to convert plain text or binary data into Base64, or select Decode to convert a Base64 string back to its original form. Toggle URL-Safe Mode if you need output suitable for URLs or filenames.
  2. 2

    Enter or paste your input

    Type or paste your text into the input field. You can also click Upload File to load an image, document, or any binary file directly from your device.
  3. 3

    View the result instantly

    The output appears in real time as you type. There is no submit button to press. The tool processes your input in your browser immediately, with zero server round-trips.
  4. 4

    Copy or download

    Click Copy to place the result on your clipboard, or click Download to save it as a file. Use Swap to quickly reverse the direction and decode what you just encoded.

Common Use Cases

1

Embedding Images in CSS and HTML

Convert small images like icons and logos to Base64 data URIs and embed them directly in your CSS or HTML. This eliminates extra HTTP requests, which can improve load times for pages with many small assets.
2

Encoding API Credentials

HTTP Basic Authentication requires credentials in the format username:password encoded as Base64. Use this tool to quickly generate the Authorization header value when testing APIs with tools like curl or Postman.
3

Creating Data URIs

Data URIs let you inline files directly in web pages or stylesheets using the data: scheme. Base64 encode fonts, SVGs, or small images and reference them without hosting separate files on a CDN.
4

Email Attachments and MIME Encoding

Email protocols like SMTP transmit data as text. MIME uses Base64 to encode binary attachments such as images, PDFs, and zip files so they can travel safely through text-only email servers.

Why use Base64 encoding?

Base64 converts binary data into ASCII text, making it safe to transmit through systems that only handle text. It's essential for embedding data in URLs, storing binary in databases, and working with APIs that expect text input.

Base64 is a binary-to-text encoding scheme defined in RFC 4648. It converts any binary data into a string of 64 printable ASCII characters: A-Z, a-z, 0-9, +, and /. The = character is used for padding when the input length is not a multiple of three bytes. This encoding is fundamental to how the modern web handles binary data in text-only contexts.

The encoding process works by taking three bytes (24 bits) of input and splitting them into four 6-bit groups. Each group maps to one of the 64 characters in the Base64 alphabet. Because 3 input bytes become 4 output characters, the encoded result is always roughly 33% larger than the original. A URL-safe variant replaces + with - and / with _ so the output can be used in URLs, cookies, and filenames without additional escaping.

Common applications include embedding images as data URIs in HTML and CSS, encoding binary attachments in email (MIME), transmitting credentials in HTTP Basic Authentication headers, and storing binary blobs in JSON or XML documents. Developers also use Base64 when working with JWT tokens, image-to-base64 conversion, and URL encoding. This tool processes everything in your browser. No data is ever sent to a server, making it safe for encoding API keys, tokens, and other sensitive strings during development.

How It Compares

Unlike server-based tools such as base64encode.org, this Base64 encoder runs entirely in your browser. Your data never leaves your device, which means there is no upload latency and no privacy risk. The tool supports both standard and URL-safe Base64, handles UTF-8 and binary files, and produces results instantly as you type. There are no usage limits, no CAPTCHAs, and no account required.

Base64 Encoding Tips

1
Base64 increases data size by approximately 33%. A 75 KB file becomes about 100 KB after encoding. Factor this overhead into bandwidth and storage calculations.
2
Use URL-safe Base64 (RFC 4648 Section 5) when the encoded string appears in URLs, query parameters, or filenames. It replaces + with - and / with _ to avoid percent-encoding issues.
3
Base64 is not encryption. Never use it to hide passwords, API keys, or sensitive data. Use proper encryption algorithms like AES-256 instead.
4
For web performance, only Base64-encode images smaller than 2-5 KB. Larger images are better served as separate files so browsers can cache them independently.
5
When decoding, watch for missing padding characters (=). Standard Base64 strings have a length that is a multiple of 4. Some systems strip padding, which can cause decoding errors.

Frequently Asked Questions

1

What is Base64 encoding?

Base64 is a binary-to-text encoding scheme that converts binary data into ASCII characters. It uses a 64-character alphabet (A-Z, a-z, 0-9, +, /) plus = for padding. It is defined in RFC 4648 and is one of the most widely used encoding formats on the web.
2

Why would I need Base64 encoding?

Base64 is useful when you need to safely transmit binary data through text-based protocols like email or JSON, embed images directly in HTML, or store binary data in databases that only support text.
3

Does Base64 increase file size?

Yes, Base64 encoding increases data size by approximately 33%. Every 3 bytes of input produce 4 bytes of Base64 output. For example, a 30 KB image becomes roughly 40 KB when Base64 encoded. Keep this overhead in mind for large files.
4

Is Base64 encoding secure?

No, Base64 is an encoding method, not encryption. It is easily reversible and should never be used for security purposes. Anyone can decode Base64 data without any key or password. For encryption, use a dedicated tool like AES or RSA.
5

Can I encode and decode files with this tool?

Yes. You can upload images, documents, or any binary file and encode them to Base64. You can also paste a Base64 string and decode it back to its original format. Everything runs in your browser, so no data is uploaded to any server.

Rate This Tool

0/1000

Get Weekly Tools

Suggest a Tool