Base64 Encoder / Decoder

Encode text or binary files to Base64 and decode Base64 back to readable text or downloadable files. Supports standard and URL-safe Base64 variants.

100% in your browserNothing is uploaded
No signup requiredUse it instantly
Free foreverNo ads on the tool

About This Tool

Base64 is one of the most misunderstood encodings in software. Despite its prevalence — in HTTP headers, JWT tokens, email attachments, and CSS data URIs — many developers are fuzzy on what it actually is and when to use it.

What Base64 is (and isn't)

Base64 is an encoding scheme, not encryption. It converts arbitrary binary data into a set of 64 printable ASCII characters (A–Z, a–z, 0–9, +, /). It is fully reversible by anyone without any key. Never rely on Base64 to hide sensitive data.

The purpose of Base64 is to make binary-safe transmission over text-only channels possible. HTTP headers, HTML attributes, and JSON strings all expect text. Base64 is how you embed an image or a certificate in those contexts without binary corruption.

URL-safe variant

Standard Base64 uses + and /, which have special meaning in URLs (query parameters, path segments). URL-safe Base64 substitutes − for + and _ for / so the output can appear in URLs without percent-encoding. JWT tokens use URL-safe Base64 without padding for exactly this reason.

Common use cases

- Encoding images as data URIs for inline CSS or HTML - Transmitting binary files through JSON APIs - Reading JWT token contents (the header and payload are Base64-encoded) - Storing binary blobs in text-only databases - Encoding email attachments (MIME uses Base64)

File encoding

This tool supports encoding files directly. Drag a file onto the input area. The tool reads the file using the FileReader API entirely in your browser and outputs the Base64-encoded string. For large files (>5MB), the output string will be very long — consider copying in chunks or using a download option.

Frequently Asked Questions

Related Tools

Last updated: May 1, 2026