Did you find this tool helpful?

Base64 Encoder & Decoder

Encode text or files to Base64, decode Base64 strings back to text. Everything runs in your browser — nothing is ever uploaded.

Mode:
Input
Output
📁
Drop any file here to encode to Base64
or browse file — any format supported
Base64 Output

What is Base64 Encoding?

Base64 is a method of converting binary data into a sequence of printable ASCII characters. It takes 3 bytes of binary data at a time and represents them as 4 characters from a 64-character alphabet (A–Z, a–z, 0–9, +, /). Because it only uses printable characters, it can be safely transmitted through systems that can't handle raw binary data.

The output is always approximately 33% larger than the original data — that's the overhead of the encoding scheme.

Common Uses of Base64

Embedding images in CSS or HTML

Instead of linking to an external image file, you can embed it directly as a Base64 data URL: background-image: url("data:image/png;base64,..."). This reduces HTTP requests at the cost of slightly larger file sizes.

JSON and API payloads

JSON only supports text strings. Binary data like images, audio, or file attachments must be Base64-encoded before embedding in a JSON body, which is common in REST APIs and email attachments (MIME format).

Authentication tokens

HTTP Basic Authentication encodes username:password in Base64 for the Authorization header. JWT tokens also use Base64URL encoding for their header and payload sections.

Standard Base64 vs URL-Safe Base64

Standard Base64 uses + and / characters, which have special meaning in URLs. URL-safe Base64 (also called Base64URL) replaces these with - and _, making the output safe to use in URL query parameters, path segments, and cookies without percent-encoding. Use the URL-safe toggle when working with JWTs or embedding Base64 in URLs.

Frequently Asked Questions

No. Base64 is an encoding scheme, not encryption. Anyone can decode a Base64 string without a key. Never use Base64 to hide sensitive data — use proper encryption (AES, RSA) for that purpose.
No. All encoding and decoding happens entirely in your browser using the built-in JavaScript btoa() and atob() functions. Your text and files never leave your device.
Base64 works in groups of 3 bytes. If the input length isn't divisible by 3, padding characters (= or ==) are added to the end to make the output length a multiple of 4. URL-safe Base64 typically omits these padding characters.
Yes. Base64 can encode any binary file — images, PDFs, audio, video, documents, executables. Switch to the File tab, drop your file, and the complete Base64 string is generated instantly in your browser.

Related Developer Tools