Base64 Encoder

Encode plain text or decode Base64 strings instantly in your browser. Supports UTF-8, Latin-1, and URL-safe Base64 variant.

base64 encode decode binary utf8
Free Client-Side Private
🔒 This tool runs entirely in your browser — your files are never uploaded to any server.

The Base64 Encoder/Decoder is a free, browser-based tool that converts text to Base64 and decodes Base64 strings back to readable text. All processing runs entirely in your browser — nothing is ever sent to a server.

Features

Feature Detail
Encode Converts plain text or binary-safe text to a Base64 string
Decode Converts a Base64 string back to the original text
UTF-8 support Correctly encodes multi-byte characters (emoji, accented letters, CJK)
Latin-1 support Handles ISO-8859-1 encoded content without mangling byte values
URL-safe variant Replaces + and / with - and _ for use in URLs and filenames
Auto-pad Automatically adds missing = padding when decoding
Load from file Upload any text file and encode or decode its contents
Copy & Download One-click copy to clipboard or save the result as a .txt file

How to Use

Encoding

  1. Click the Encode tab (active by default).
  2. Paste or type the text you want to encode, or click Load file to upload a file.
  3. Select the input charset (UTF-8 for modern text, Latin-1 for legacy/binary content).
  4. Optionally check URL-safe to get a variant safe for use in URLs and HTTP headers.
  5. Click Encode to Base64 and copy or download the result.

Decoding

  1. Click the Decode tab.
  2. Paste the Base64 string you want to decode.
  3. Select the correct charset (use UTF-8 unless you know the source used Latin-1).
  4. Click Decode from Base64 and inspect the output.

UTF-8 vs Latin-1

UTF-8 is the standard encoding for the web. Use it for any modern text that may contain characters outside the basic ASCII range — accented letters, emoji, Arabic, Chinese, Japanese, Korean, and so on. When encoding, the tool converts the JavaScript string to raw UTF-8 bytes before applying Base64.

Latin-1 / ISO-8859-1

Legacy encoding covering the first 256 Unicode code points. Use it when you need to encode raw binary data that has already been loaded as a Latin-1 string, or when interoperating with older systems that produce Latin-1 Base64 output. Characters with code points above 255 will produce an error in Latin-1 mode — switch to UTF-8 in that case.

URL-safe Base64

Standard Base64 uses the characters +, /, and = which have special meanings in URLs. The URL-safe variant (defined in RFC 4648 §5) replaces + with - and / with _, making the output safe to embed directly in query strings, path segments, JSON Web Tokens (JWT), and filenames without percent-encoding.

The decoder in this tool automatically accepts both standard and URL-safe input, so you do not need to convert manually before decoding.

Common Use Cases

  • Encoding binary data (images, PDFs) as text for embedding in JSON, XML, or HTML
  • Decoding data: URIs to inspect embedded content
  • Working with HTTP Basic Authentication headers (Authorization: Basic …)
  • Inspecting or creating JSON Web Tokens (JWT) — the header and payload sections are Base64url-encoded
  • Encoding API keys or credentials for transmission in plain-text protocols
  • Debugging base64-encoded email attachments (MIME)

Frequently Asked Questions

Is Base64 encryption?

No. Base64 is an encoding scheme, not encryption. It converts binary data to ASCII text so it can be safely transmitted over text-based protocols. Anyone can decode a Base64 string instantly — it provides no confidentiality.

Why does my decoded output look like garbage?

The most common cause is a charset mismatch. If the original text was encoded as Latin-1 but you are trying to decode as UTF-8 (or vice versa), the output will contain incorrect characters. Try switching the charset and running again.

Can I encode images or PDFs to Base64?

This tool handles text files. To encode binary files such as images, load the file — the FileReader API reads it as text using the selected charset. For truly binary files, a dedicated binary-to-Base64 tool is more appropriate.

What is the size overhead of Base64?

Base64 expands data by approximately 33%. Every 3 bytes of input become 4 ASCII characters. The Ratio stat in the output shows the exact factor for your specific input.

Does the tool support line-wrapped Base64?

Yes. The decoder strips all whitespace (spaces, newlines, tabs) before processing, so MIME-wrapped Base64 (typically 76 characters per line) decodes correctly without any pre-processing.

What is the maximum input size?

There is no hard limit — processing is done entirely in browser memory using JavaScript. Very large inputs (several megabytes) may be slow depending on your device.

Report an issue