Base64 Encoder / Decoder
Encode any text to Base64, or decode Base64 back to plain text -- instantly, entirely in your browser.
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
- Treating Base64 as protection. It hides nothing. Never store passwords or API keys as Base64 and consider them safe.
- Decoding text that is not Base64. A sentence with spaces or a Base64url string containing
-or_will return an invalid-input error. Swap those two characters back to+and/first. - Pasting a full data URI. Remove the
data:image/png;base64,prefix and paste only the encoded part. - Expecting binary files to decode into readable text. Decoding an image or PDF string gives bytes that are meaningless as text, and the tool may show an error or garbage.
- Forgetting the size cost. Embedding large images inline makes a page about a third heavier than the file itself.
Where You Would Use This
- Inspecting the header or payload section of a token during debugging.
- Creating a quick Basic Auth value to test an API from the command line.
- Embedding a tiny icon directly in CSS or an HTML email.
- Decoding a Base64 field in a JSON response to see what a service actually sent.
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.