DevToolCase
Sign in Sign in

Encode to Base64

Convert text to Base64, accents and emoji included, with the URL-safe variant; decode it in one click.

Share this result

Encrypted in your browser. The key stays in the link, after “#”: only the people you give it to can read it, not even DevToolCase.

The link works for

Sign in for longer links or links without expiry, and to find them in your account.

Runs entirely in your browser: nothing you type is sent or stored.

What is Base64?

Base64 writes any data with 64 characters that travel safely everywhere: letters, digits, + and /. It is used wherever only text is allowed: e-mail attachments, images inside HTML or CSS (data: URLs), HTTP Basic authentication, JSON Web Tokens…

Why does the result end with “=”?

Base64 turns every 3 bytes into 4 characters. When the data is not a multiple of 3 bytes long, one or two = complete the last group. That is also why Base64 is about a third longer than the original: Hello (5 bytes) becomes SGVsbG8= (8 characters).

Accents and emoji

The text is first written in UTF-8, then in Base64: é takes 2 bytes, an emoji 4. This is what other tools and programming languages expect, whereas JavaScript's btoa() fails on any accented character.

Base64URL: the URL-safe variant

In a URL or a file name, + and / have a meaning of their own. Base64URL replaces them with - and _ and drops the final =. JSON Web Tokens use it. Tick “URL-safe” to get it.

Base64 is not encryption

Anyone can decode Base64 in one click: never use it to hide a password or a secret. To check that a file has not changed, compute its hash instead.

Add this browser’s favorites to your account?

This browser has 0 favorites that your account does not have:

Either way, this browser keeps its favorites: you find them again after signing out.