Base64 encoder
Encode any string input to Base64.

Base64 encoder is a free tool that converts text into standard Base64-encoded data.
How are three bytes represented as four characters?
Base64 divides input data into groups of three bytes and represents each group with four printable ASCII characters. Its standard alphabet contains uppercase letters, lowercase letters, digits, plus signs, and slashes. Equal signs may appear at the end as padding when the final group contains fewer than three bytes.
A small example of this encoder's output looks like this:
- Input: cat
- Output: Y2F0
The encoded value is longer, but it can pass through systems designed primarily for text. That is why Base64 is used when raw bytes could be damaged, misread as control characters, or rejected by a text-based format.
Base64 is a reversible encoding. Anyone who has the encoded value can decode it without a password or secret key, so it provides no confidentiality.

What does this encoder send and return?
The encoder sends your input to the server over HTTPS and returns the converted value in the Base64 encoded field. The input is not stored. Because processing happens on the server, avoid submitting passwords, private keys, access tokens, or regulated data unless server-side handling is acceptable for your task.
The encoder's Base64 encoded field uses standard Base64. Enter the exact text you need to transport, submit it, and copy the returned value without adding spaces or punctuation. If you need to reverse the operation later, use a Base64 decoder.
The output represents the bytes supplied to the encoder. It does not describe the original file type, character encoding, file name, or intended use. A receiving system may need that information separately.
Base64 in common data paths
Base64 commonly appears where binary data has to fit inside text-oriented documents or protocols. The surrounding format determines whether standard Base64 is accepted directly or requires additional escaping.
- Data URLs can embed an image, font, or other resource in HTML or CSS. An optional media type may appear before the ;base64 marker, which is required when Base64 encoding is used.
- Query strings can carry encoded values, but standard Base64 characters may have special URL meanings. A plus sign can be interpreted as a space by form-style query parsing. Base64url, or URL encoding applied to standard Base64, is usually safer for this location.
- Email uses Base64 as a MIME content-transfer encoding for attachments and message parts that cannot travel reliably as plain text.
- JSON payloads sometimes represent images, documents, or cryptographic bytes as Base64 because JSON has no native binary data type.
- Internationalized domain names use Punycode for IDNA A-labels. Separately, a certificate's PEM body may contain Base64-encoded certificate data.
Standard Base64 uses + and /. Base64url replaces them with - and _, and some Base64url formats omit trailing padding. This encoder produces standard Base64, so convert the alphabet when a protocol explicitly requires Base64url.

A diagnostic checklist for rejected or unreadable values
Decode problems usually come from a format mismatch, copying damage or incomplete input, repeated encoding, or an incorrect assumption that the decoded bytes are text. Check the value's format against this encoder's standard Base64 output before concluding that the source data is corrupt.
- Check the alphabet. A decoder expecting standard Base64 may reject Base64url characters, while a Base64url parser may not accept plus signs or slashes.
- Restore required padding. Some systems omit trailing equal signs. Lenient decoders may accept that form, while strict decoders require a valid padded length.
- Check for copying damage. Truncation, inserted spaces, changed line breaks, or a plus sign converted to a space can make an otherwise valid value fail.
- Look for double encoding. Decoding once may produce another Base64-looking value if the source encoded the data twice. Decode a second time only when the producing system confirms that behavior.
- Treat binary output as bytes. An image, compressed archive, or encrypted payload will look like gibberish in a text editor. Save or process it according to its actual media type instead.

How should spaces, Unicode, and empty input be treated?
Base64 preserves distinctions between input bytes, so spaces, punctuation, capitalization, and line endings all affect the result. A trailing space produces a different value from the same text without that space. Windows CRLF line endings also encode differently from LF line endings commonly used on Unix-like systems.
Accented and non-Latin characters must first exist in a character encoding such as UTF-8. Base64 stores encoded bytes representing the characters. A receiving system must decode the Base64 and then interpret the resulting bytes with the same character encoding.
Numbers entered into a text field are encoded as digit characters. For example, the text 123 is different from a binary integer whose numeric value is 123. Empty input produces no encoded content under the Base64 operation.
Very long input expands to roughly four encoded characters for every three input bytes, plus possible padding. Browser, request, memory, or server limits may therefore matter for very long strings, and this tool does not state a maximum input size.
Base64 questions people often ask
Does Base64 compress data?
No. Base64 normally increases the data size by about one-third before any surrounding headers or metadata are added. Compress data first when a protocol permits compression and smaller transfer size is the goal.
Can I identify Base64 just by looking at it?
You can recognize common signs, such as a restricted character set and optional equal signs at the end, but appearance alone is not proof. Ordinary words, identifiers, and random tokens can also happen to satisfy Base64 syntax.
Why do JWT segments look like Base64?
Signed or unsecured compact JSON Web Tokens use Base64url for their header and payload segments. In those forms, the header and claims remain readable after decoding; a signature provides no encryption. Encrypted JWTs use JWE and do not expose their claims merely through Base64url decoding. Standard Base64 output may need alphabet and padding changes before it fits a JWT-related format.
Should ordinary JSON text be Base64 encoded?
Usually no. JSON already supports text, including Unicode characters when encoded correctly. Base64 is mainly useful inside JSON when a field must carry binary bytes or when an API contract explicitly requires it.
What metadata should accompany Base64-encoded file data?
Keep the media type, and any original file name or character encoding the receiving application requires, in separate fields or headers. Base64 alone cannot tell a recipient whether decoded bytes represent a PNG image, a PDF, plain text, or another format. If the result is image data, Base64 to Image can help with the next conversion step.
Similar tools
Popular tools
Create a WhatsApp chat link from a phone number, with an optional prefilled message.