UseBoldTools logo

Base64 Encoder & Decoder

Encode text to Base64 or decode Base64 back to plain text. No data is sent to any server.

Encode mode
Input
Output
All processing happens in your browser No data is stored or sent to any server Supports UTF-8 text

What is Base64?

Base64 is a binary-to-text encoding scheme that converts arbitrary binary data into a string of 64 printable ASCII characters: A–Z, a–z, 0–9, +, /, and = for padding. Because the output contains only safe printable characters, Base64-encoded data can be reliably transmitted through systems that are designed to handle text — such as HTTP headers, JSON payloads, XML documents, and email protocols.

Base64 increases the size of the encoded data by roughly 33%, which is the trade-off for universal text compatibility. It is not a compression format and is not a security measure.

How to Encode and Decode Base64

Encoding text to Base64

  1. Paste or type your plain text into the Input box.
  2. Click Encode — the Base64 string appears instantly in the Output box.
  3. Click Copy Output to copy the result to your clipboard.
  4. Enable Live mode to encode automatically as you type.

Decoding Base64 to text

  1. Paste the Base64 string into the Input box.
  2. Click Decode — the original text appears in the Output box.
  3. If the input is a Base64-encoded image, a live preview is shown below the editor.
  4. Use Swap to move the output back to input for further processing.

Common Base64 Errors

Invalid characters

Base64 only allows A–Z, a–z, 0–9, +, /, and =. Spaces, line breaks, or other characters will cause a decode failure.

Incorrect padding

A valid Base64 string length must be a multiple of 4. Missing or extra = padding characters at the end will cause decoding to fail.

Truncated string

Copying only part of a Base64 string is the most common mistake. Make sure you copy the entire output, including the trailing = or == if present.

URL-safe Base64

Some systems use a URL-safe variant that replaces + with - and / with _. Standard decoders will reject this. Replace those characters before decoding.

Common Use Cases

Embedding images in HTML/CSS

Encode small images as Base64 data URIs to inline them directly in markup without a separate HTTP request.

HTTP Basic Authentication

Credentials in the format username:password are Base64-encoded and sent in the Authorization header.

JSON API payloads

Binary file contents (PDFs, images) are often Base64-encoded before being embedded in a JSON field for transport.

Email attachments (MIME)

The SMTP protocol is text-based. Email clients encode binary attachments in Base64 so they can be transmitted safely.

JWT tokens

JSON Web Tokens use URL-safe Base64 (Base64url) to encode the header and payload sections.

Storing binary data in databases

Text-only database fields or config files can store binary data safely when it is Base64-encoded first.

Frequently Asked Questions

Is Base64 a form of encryption?

No. Base64 is encoding, not encryption. Anyone who receives a Base64 string can decode it instantly with no key or password required. If you need to protect sensitive data, use a proper encryption algorithm such as AES-256.

Why do developers use Base64?

Base64 solves a practical problem: many systems — HTTP headers, JSON, XML, email — are designed for text and can corrupt or reject raw binary data. Base64 converts binary to safe printable characters, guaranteeing the data arrives intact regardless of what systems it passes through.

Is it safe to encode sensitive data with this tool?

The tool itself is safe — all processing happens in your browser and nothing is sent to a server. However, Base64 itself provides no confidentiality. Anyone who obtains the encoded string can decode it. Do not mistake "encoded" for "encrypted".

Why does my Base64 decoding fail?

The most common reasons are: the string contains invalid characters (spaces, line breaks, or URL-safe variants like - and _), the string was truncated and is missing padding (=), or the length is not a multiple of 4. Copy the complete Base64 string and try again.