Base64 Encoder & Decoder
Encode plain text to Base64 or decode Base64 strings back to text.
Client-Side Execution & Privacy Guarantee
This utility executes 100% locally in your web browser. Your inputs, tokens, queries, and data payloads are never transmitted to any external server or backend.
Base64 represents binary data as a sequence of printable ASCII characters. It is commonly used when binary content must travel through systems that only accept text, such as JSON payloads, email attachments, or data URIs.
The encoder converts any UTF-8 text into its Base64 form. The decoder reverses the process, restoring the original characters. Both operations run locally so secrets or large strings never leave the browser.
Encoding alphabet and padding
Standard Base64 uses the characters A-Z, a-z, 0-9, +, and /. Every three input bytes become four output characters. When the input length is not a multiple of three, the output is padded with one or two equals signs.
The padding ensures that decoders can determine the exact original length. Most modern Base64 implementations accept input without padding, but the tool produces the conventional padded form.
URL-safe variant
A URL-safe alphabet replaces + with - and / with _ so the string can appear in query parameters or path segments without further escaping. The tool focuses on the standard alphabet; for URL-safe output you can replace the two characters after encoding.
When decoding, the tool accepts both the standard and URL-safe alphabets. Extra whitespace is ignored so you can paste values that have been line-wrapped.
Text versus binary
The interface treats the input as text and converts it to UTF-8 bytes before encoding. When you decode, the resulting bytes are interpreted as UTF-8. If the original data was arbitrary binary, the decoded text may contain replacement characters.
For true binary files, encode the raw bytes rather than a text representation. The tool is intended for textual data and short binary snippets that can be represented as text.
When to use this tool
- Embedding a small image or icon as a data URI
- Placing binary content inside a JSON string
- Decoding a Base64 value received from an API
- Converting a token or key for inspection
- Testing encoding round-trips during development
How to use the Base64 Encoder & Decoder
- Choose encode or decode mode.
- Paste the text or Base64 string into the input box.
- Click the convert button.
- Copy the result from the output area.
- For large strings, verify the length matches expectations before using the value.
- Switch modes and paste the output back to confirm a round-trip if you are unsure.
- Clear the fields after use if the data is sensitive.
Worked examples
Encode a short phrase
Hello
SGVsbG8=
The equals sign is padding because the input length is not a multiple of three.
Decode a common value
SGVsbG8gV29ybGQh
Hello World!
Padding is optional on decode; the tool accepts the string with or without the trailing equals signs.
Common mistakes and tips
- Base64 expands data by roughly 33 percent. Do not use it as a general compression method.
- Line breaks inside a Base64 string are ignored on decode, which helps when values come from email or PEM files.
- Never treat Base64 as encryption. Anyone can decode the string without a key.
- When embedding in HTML or CSS data URIs, remember that the Base64 portion still needs to be valid for the chosen MIME type.
- Unicode characters are encoded as their UTF-8 byte sequences, so multi-byte characters produce longer Base64 strings.
Frequently asked questions
Why does my output end with equals signs?
The equals signs are padding. They indicate how many bytes were missing to complete the final group of three. They are part of the standard encoding.
Can I decode URL-safe Base64?
Yes. The decoder accepts both +/ and -_ alphabets and ignores whitespace.
What happens with invalid Base64?
The tool reports an error. Common causes are missing characters, illegal symbols, or incorrect padding.
Does the tool support large inputs?
Inputs of several megabytes are handled in memory. Extremely large strings may slow the browser tab but are never uploaded.
Is the encoding reversible?
Yes, for valid UTF-8 text. Encoding then decoding restores the original characters exactly.