How to Use This Tool
Base64 exists because a lot of the internet was built assuming text. Email headers, JSON fields, XML attributes, URL parameters and CSS files all handle letters and digits reliably and choke on raw binary. Base64 converts arbitrary bytes into 64 characters that survive every one of those channels. What it does not do — despite being used this way constantly — is compress or secure anything.
Encoding and decoding
Choose a direction, then type or paste into the top box. The result appears below as you type. Two
things this tool handles that a naive implementation gets wrong: UTF-8 and
files. The browser's built-in btoa() throws an exception on any character
above U+00FF, so a single accented letter or emoji breaks it. This tool encodes to UTF-8 bytes first, so
"café" and "日本語" round-trip correctly. Use Load a file for images, PDFs or anything binary; the
file is read locally and never uploaded.
The size penalty you should know about before you paste
Base64 takes every 3 bytes and produces 4 characters, which makes the output roughly 33% larger than the input, plus padding. This matters more often than people realise: inlining a 4 MB image as a data URI adds about 1.4 MB of pure overhead to your page, and embedding a large attachment in a JSON API request can push it past a gateway's payload limit for no functional benefit.
URL-safe and wrapping options
Standard Base64 uses + and /, both of which have meaning inside a URL and get
mangled by percent-encoding. The URL-safe toggle swaps them for - and
_ and drops the = padding, which is the variant used by JWTs and most modern
APIs. The wrap at 76 option inserts line breaks at the width MIME expects, which some
older mail and certificate tools require and most modern parsers ignore.
What Base64 is not
It is not encryption and not obfuscation. Anyone can decode it instantly, including every automated secret scanner. Putting a password, API key or token in Base64 and treating it as hidden is a genuinely common and genuinely serious mistake. If the value needs protecting, it needs encryption; Base64 is only the envelope that lets encrypted bytes travel through a text channel.