Base64 Encode / Decode
convert
output
options
About Base64 encoding
Base64 encodes arbitrary binary data as printable ASCII characters, making it safe to embed in JSON, HTML, CSS data URIs, or email. Text is encoded as UTF-8 bytes first, so non-ASCII characters round-trip correctly. The URL-safe variant replaces +and / with -and _ for use in URLs and filenames without percent-encoding.
When to use it
Base64 is everywhere in day-to-day development. Inline an image or font as a data URI to avoid an extra HTTP request, attach binary files to plain-text-only channels such as email, or store small binary payloads (thumbnails, favicons, config blobs) inside a JSON document. API tokens, JWTs, and similar compact identifiers use a Base64url variant — exactly what theURL-safe option in this tool produces.
Choose No padding when the consumer expects an unpadded string: JWT segments and some web APIs strip the trailing = characters. If the data will live inside a URL path or query string, pair URL-safe mode with the URL encoder, because + and / retain special meaning in query strings even after the Base64url substitution.
How this tool works
Everything runs in your browser using the native btoa /atob APIs. Text is converted to UTF-8 bytes before encoding, so emoji, accented letters, and CJK characters round-trip losslessly. TheOpen file button reads a file into memory and encodes its raw bytes, letting you encode any binary format without passing it through a text layer first.
Edge cases and limitations
Base64 grows data by roughly 33 % — it is a transport encoding, not compression, so there is no size saving. It is not encryption: anyone can decode it, so never rely on it to protect secrets. Decoding accepts the URL-safe alphabet and re-adds missing padding automatically, but genuinely malformed input reports Invalid Base64 rather than emitting garbage. File sizes are bounded only by your browser's available memory.
Example
Encode Hello and you getSGVsbG8=. The same string in URL-safe, no-padding form is SGVsbG8.
Related tools
Pair Base64 with the URL Encode / Decodetool for URL-safe payloads, the ASCII converterwhen you need to inspect raw byte values, and the UUID generatorfor a binary-safe identifier that never needs encoding at all.
FAQ
Is my data sent anywhere?
No. Encoding and decoding happen entirely in your browser using the native btoa/atob APIs.
Can I encode binary files?
Yes — use the Open file button. The file is read into memory and encoded without any server round-trip.