Choose text or a file
Text encodes and decodes in the first box; files and images in the second.
Encode text to Base64 or decode it back, and convert whole files and images into Base64 or a data URI. You can also turn Base64 back into a downloadable file.
100% private — everything is converted in your browser and nothing is uploaded.
100% private — everything is converted in your browser and nothing is uploaded.
Keep going with your result in another tool. Nothing is uploaded.
Text encodes and decodes in the first box; files and images in the second.
URL-safe, line breaks, or a data URI prefix, depending on where you will use it.
Copy the Base64, or download the decoded file.
Base64 is a way of writing any data, including files, images and arbitrary bytes, using only 64 safe characters: letters, digits, plus and slash. That makes it possible to send binary content through channels that only handle text, such as email bodies, JSON documents, URLs, HTML and CSS, configuration files and HTTP headers. It is also how a small image can be embedded directly in a web page as a data URI. Encoding makes the data about a third larger, and it is a format, not encryption: anyone can decode it.
The first section converts text. Text is first turned into UTF-8 bytes, so accented letters, symbols and emoji encode and decode correctly, which is where quick tools often go wrong. Pasting Base64 and choosing decode gives you back the text. If the decoded data is not valid text, for example because it is an image, the tool says so and points you to the file section.
Standard Base64 uses + and /, which have special meanings in URLs, and ends with = padding. The URL-safe variant replaces them with - and _ and drops the padding, and is used in JSON Web Tokens and in links. The MIME variant breaks the output into lines of 76 characters, as email requires. Decoding accepts all of these forms and ignores spaces and line breaks.
The second section encodes a whole file. Choose a file and you get its Base64, optionally with the data: prefix that turns it into a data URI you can paste into an HTML img tag or a CSS url(). Images are previewed, and the size increase is shown. The reverse direction takes Base64 or a data URI, detects the type of file from its first bytes, and lets you download it with a name of your choice, useful for recovering an attachment or an image embedded in a document.
Base64 is not a way to protect data: it hides nothing. Big files make very long strings, and embedding large images as data URIs slows a page down more than referring to a file. Files above 100 MB are not accepted, since everything is processed in memory. For percent-encoding of URLs, use the URL encoder.
More utilities that also run without leaving your browser.