Base64 Encode
Encode text or files to Base64, with standard or URL-safe alphabets and optional line wrapping.
Input
Output
What Base64 encoding does
Base64 rewrites arbitrary bytes using only 64 printable ASCII characters, so binary data can travel through channels that were designed for text — email bodies, JSON fields, HTML attributes, HTTP headers.
Three input bytes become four output characters, which is why a Base64 string is always about 33% larger than its source. That overhead is the price of safety, not a flaw.
How to use this encoder
- Paste or type your text in the input panel on the left.
- Choose URL-safe if the result will be placed in a URL or a filename — it swaps + and / for - and _.
- Turn off padding when the receiving system rejects trailing = characters, as JWT and some APIs do.
- Enable 76 characters per line for MIME/email payloads, or leave it off for a single continuous string.
- Copy the result, or download it as a text file.
Standard vs URL-safe alphabet
The standard alphabet (RFC 4648 §4) uses + and /. Both are reserved characters in URLs, so a token containing them gets percent-encoded and becomes unreadable.
The URL-safe alphabet (RFC 4648 §5) replaces them with - and _, which pass through URLs, form fields and filenames untouched. JSON Web Tokens use this variant with padding removed.
Frequently asked questions
Is my data sent to a server?
No. Encoding runs entirely in your browser using the TextEncoder API. Nothing is uploaded, logged or stored, and the tool keeps working with your network disconnected.
Is Base64 encryption?
No. Base64 is an encoding, not encryption: anyone can decode it without a key. Never use it to protect passwords, tokens or personal data — use real encryption for that.
Why is my encoded string longer than the original?
Base64 represents every 3 bytes as 4 characters, so the output grows by roughly one third. Padding characters (=) add up to two more.
How do I encode an image or a PDF?
Use the File to Base64 tool instead. It reads the file locally and gives you both the raw Base64 and a ready-to-paste data: URI.