Base64 Encoder
Encode plain text or decode Base64 strings instantly in your browser. Supports UTF-8, Latin-1, and URL-safe Base64 variant.
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
- Click the
Encodetab (active by default). - Paste or type the text you want to encode, or click
Load fileto upload a file. - Select the input charset (
UTF-8for modern text,Latin-1for legacy/binary content). - Optionally check
URL-safeto get a variant safe for use in URLs and HTTP headers. - Click
Encode to Base64and copy or download the result.
Decoding
- Click the
Decodetab. - Paste the Base64 string you want to decode.
- Select the correct charset (use
UTF-8unless you know the source used Latin-1). - Click
Decode from Base64and inspect the output.
UTF-8 vs Latin-1
UTF-8 (recommended)
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.