What Base64 is
Base64 turns bytes into text using 64 safe characters: A–Z, a–z, 0–9, + and /. Every 3 bytes become 4 characters, so encoded data is about a third larger than the original. When the input length isn't a multiple of 3, one or two = signs pad the end.
It exists so binary data can travel through systems that only handle text, such as JSON, email, HTML attributes and HTTP headers.
Examples
Hello -> SGVsbG8= Hi -> SGk= user:secret -> dXNlcjpzZWNyZXQ=
This tool encodes text as UTF-8 first, so accented letters, emoji and non-Latin scripts round-trip correctly.
Standard vs URL-safe Base64
+ and / have special meanings in URLs, so URL-safe Base64 (often called base64url) replaces them with - and _, and usually drops the = padding. JWTs use base64url for all three parts. Turn on URL-safe in the tool when the string is going into a URL, a file name or a token, or when you're decoding one of those.
Base64 is not encryption
Anyone can decode Base64; it hides nothing. HTTP Basic auth, for example, sends Authorization: Basic dXNlcjpzZWNyZXQ=, which is just user:secret encoded, so it must only be used over HTTPS. If you need to protect data, encrypt it, and for passwords use a slow hash like bcrypt (Bcrypt Generator).
Data URLs
A data URL embeds a file directly in HTML or CSS: data:image/png;base64, followed by the encoded bytes. It saves a network request for small icons but makes the page larger and can't be cached separately. To make one from an image, use Image to Base64.