Base64 Encoder / Decoder
Encode text or files to Base64, or decode Base64 back to plain text.
Plain text
Base64 encoded
Output will appear here
Encode a file to Base64
Drop a file here or click to browse
Any file type · Max 5MB
What is Base64?
Base64 is an encoding scheme that converts binary data into a string of ASCII characters. It uses 64 printable characters (A–Z, a–z, 0–9, +, /, and = for padding) to represent binary data in a text-safe format.
Base64 is used everywhere in web development: embedding images as data URIs in HTML and CSS, encoding attachments in email (MIME), transmitting binary data in JSON APIs, encoding credentials in HTTP Basic Auth headers, and storing binary data in XML or JSON where raw bytes aren't allowed.
The URL-safe variant replaces + with - and / with _, making the output safe for use in URLs and filenames without percent-encoding.
Frequently Asked Questions
No. Base64 is an encoding scheme, not encryption. Anyone who sees a Base64 string can decode it instantly — there's no secret key involved. Never use Base64 to protect sensitive data. It simply makes binary data text-safe for transport. If you need to protect data, use proper encryption (AES, RSA) or hashing (bcrypt for passwords).
Base64 encodes every 3 bytes of binary data as 4 ASCII characters, resulting in approximately a 33% size increase. This is the trade-off for text-safe representation. For large files, this overhead matters — embedding a 1MB image as Base64 in HTML produces ~1.37MB of text. For small assets (icons, fonts), the convenience often outweighs the size cost.
Use URL-safe Base64 whenever the encoded string will appear in a URL query parameter, a filename, or a JWT (JSON Web Token). Standard Base64 uses
+ and /, which have special meanings in URLs and must be percent-encoded as %2B and %2F. URL-safe Base64 avoids this by using - and _ instead, which don't need escaping.