// plain text
📂
Drop file here or click to browse
Any file type supported
// base64
Ready — enter text and click Convert

About Base64

Base64 is an encoding scheme that converts binary data into ASCII text using 64 printable characters. It's widely used to transmit binary data over systems that handle text, like email or URLs.


Features:

Common Use Cases

🔐Encoding credentials in HTTP Basic Auth headers
📧Embedding images in HTML/CSS as data URIs
🔑Storing binary data in JSON or XML payloads
🌐Encoding data in URL parameters safely
📦Passing binary data through text-only APIs
🛡Encoding JWT header and payload sections

// what is base64 encoding?

Base64 encoding converts binary data into a set of 64 ASCII characters (A–Z, a–z, 0–9, +, /). Each 3 bytes of binary data becomes 4 Base64 characters, making encoded output about 33% larger than the original.

Base64 is not encryption — it's purely an encoding scheme. Anyone can decode it. Read our full guide: what is Base64? and the comparison: Base64 vs hex encoding.

// base64 vs url-safe base64

Standard Base64 uses + and / which have special meaning in URLs. URL-safe Base64 replaces these with - and _.

JWT tokens use URL-safe Base64 without padding for the header and payload sections. See our JWT Decoder to decode JWT tokens directly.

// frequently asked questions
How do I encode a string to Base64 in JavaScript?
Use btoa(string) for ASCII strings. For Unicode text use: btoa(unescape(encodeURIComponent(string))). To decode, use atob(base64string). Read the full guide: encode images to Base64 in JavaScript.
How do I encode a string to Base64 in Python?
Use the base64 module: import base64; base64.b64encode(b"Hello World"). To decode: base64.b64decode("SGVsbG8gV29ybGQ="). For URL-safe Base64 use base64.urlsafe_b64encode().
Is Base64 the same as encryption?
No — Base64 is an encoding scheme, not encryption. It is completely reversible by anyone and provides no security. Do not use Base64 to hide sensitive data. Use proper encryption (like AES) for security and Base64 only for data transport compatibility.
How do I embed an image as Base64 in HTML?
Use the File tab above to encode your image, then use the output as a data URI: <img src="data:image/png;base64,YOUR_BASE64_HERE">. This embeds the image directly in your HTML without a separate file request. See our guide: encode images to Base64.
What is the difference between Base64 and hex encoding?
Both convert binary data to text, but Base64 is more compact — it uses 4 chars per 3 bytes (33% overhead) while hex uses 2 chars per byte (100% overhead). Base64 is preferred for large data like images. Hex is easier to read for debugging small binary values. Full comparison: Base64 vs hex.