Base64

Base64 Encoder / Decoder

Encode any text to Base64, or decode Base64 back to plain text -- instantly, entirely in your browser.

Input
Output
Output appears here...
⚠️

Disclaimer: This tool runs entirely in your browser -- nothing you enter is sent to or stored on our servers.

What Base64 Encoding Actually Does

Base64 encoding converts binary data into a text-safe ASCII string using 64 printable characters (A-Z, a-z, 0-9, +, /). It is not encryption -- anyone can decode Base64 instantly, so never use it to protect sensitive data. Base64 increases data size by approximately 33% (every 3 bytes become 4 characters), and it's used to embed binary data such as images and files into text-based formats like JSON, XML, HTML, CSS, and email attachments.

Common use cases: embedding images as data URIs in CSS or HTML (data:image/png;base64,...); HTTP Basic Authentication headers where username:password is Base64-encoded; JWT tokens where the header and payload are Base64url-encoded; storing binary data in JSON API responses; and encoding file attachments in SMTP email using MIME encoding. Base64url is a variant using hyphen and underscore instead of plus and slash, making it safe for URLs and filenames without percent-encoding.

Worked Example

Encoding the text "Hello, SmartUtilz!" produces SGVsbG8sIFNtYXJ0VXRpbHoh -- and decoding that string back returns the original text exactly, demonstrating that Base64 is fully reversible (unlike a hash, which is one-way).

Second Worked Example: Credentials and Accented Text

The string admin:s3cret (12 characters) encodes to YWRtaW46czNjcmV0 (16 characters), a size ratio of 1.33x. This is the pattern used in an HTTP Basic Authentication header, and it shows why that header must only travel over an encrypted connection: anyone who sees it can paste it back into Decode. Non-English characters work too, because the tool converts text to UTF-8 first. Café ₹500 (9 characters) becomes Q2Fmw6kg4oK5NTAw (16 characters). Short inputs show a larger ratio because of padding: Hi becomes SGk= and A becomes QQ==.

Common Mistakes

Where You Would Use This

Tips for Reliable Results

Watch the length figures under the output. For plain English text the encoded version should be around one third longer, so a result that is much larger or smaller than that suggests the input contained unusual characters or whitespace. Trailing equals signs are padding and should be kept when you move the string to another system, since some strict decoders require them. Trim stray line breaks that were copied along with a value before decoding, because they are a common reason for an invalid-input message. The swap button is useful for a round-trip check: encode, swap, decode, and confirm you get the original back.

Frequently Asked Questions

No -- Base64 is an encoding scheme, not encryption. It has no secret key and anyone can decode it instantly using any Base64 decoder (including this one). If you need to protect sensitive data, use actual encryption (like AES) rather than Base64 encoding alone.
Base64 encodes every 3 bytes of input as 4 output characters, so encoded text is always about 33% larger than the original data. This overhead is the tradeoff for making binary data safely representable in text-only formats like JSON, XML, or email.
Standard Base64 uses '+' and '/' as two of its 64 characters, both of which have special meaning in URLs. Base64url replaces these with '-' and '_' instead, making the output safe to use directly in URLs and filenames without additional percent-encoding -- commonly seen in JWT tokens.