Base64 Encode & Decode

Encode text to Base64 or decode Base64 back to plain text. Supports UTF-8 and Unicode.

Text / UTF-8
Base64
Standard Base64
Uses A–Z, a–z, 0–9, +, / with = padding
URL-safe variant
Replace + with - and / with _ (RFC 4648)
UTF-8 safe
Full Unicode support including emoji and CJK

Frequently asked questions

What is Base64 encoding?
Base64 is a way to represent binary data using only printable ASCII characters (A–Z, a–z, 0–9, +, /). It encodes every 3 bytes of input into 4 characters of output, making binary-safe data safe to include in text contexts like emails, HTML, JSON, and URLs.
When is Base64 used?
Common uses include: embedding images directly in HTML or CSS (data URIs), encoding email attachments (MIME), passing binary data in JSON API payloads, storing credentials in HTTP Basic Auth headers, and encoding JWT tokens.
Is Base64 encryption?
No. Base64 is encoding, not encryption. It does not use a key and provides zero security — anyone can decode it instantly. It is only for safe transport of binary data, not for hiding information.
What is the difference between standard and URL-safe Base64?
Standard Base64 uses + and / characters, which have special meaning in URLs. URL-safe Base64 (RFC 4648) replaces + with - and / with _ so the output can be safely used in URLs and filenames without percent-encoding.
How do I decode a Base64 image string?
A Base64-encoded image looks like data:image/png;base64,iVBORw0KGgo... — paste the part after the comma into the decoder. The tool will decode it to raw bytes. To preview the image, paste the full data URI string (including the data:image/... prefix) directly into your browser's address bar.
Does Base64 increase file size?
Yes — Base64 encoding increases the data size by approximately 33%. Every 3 bytes of input become 4 Base64 characters. This overhead is acceptable for small strings and images embedded in HTML, but for large files it is better to serve them as separate binary resources.
How do I encode or decode Base64 in JavaScript?
In the browser, use btoa('your string') to encode and atob('encoded') to decode. For Unicode text, wrap with encodeURIComponent/decodeURIComponent first: btoa(unescape(encodeURIComponent(text))). In Node.js, use Buffer.from('text').toString('base64') to encode and Buffer.from(b64, 'base64').toString() to decode.