What Base64 is for
Base64 turns any data into 64 safe characters: A to Z, a to z, 0 to 9, + and /. It's used wherever binary data has to travel through something built for text, such as email attachments, images embedded in web pages or JSON, and HTTP Basic authentication headers. AI APIs use it too: images are usually sent to a vision model as Base64 inside the JSON request.
Every 3 bytes become 4 characters, so Base64 is about a third bigger than the original. If the length isn't a multiple of 3, it's padded with =.
Base64URL
Standard Base64's + and / have special meanings in URLs, so the URL-safe variant uses - and _ instead and usually drops the padding. JSON Web Tokens (JWTs) use it.
URL encoding
URL encoding, or percent-encoding, replaces characters that aren't allowed in part of a URL with % and their UTF-8 bytes in hex. A space becomes %20 and Ω becomes %CE%A9. This tool encodes the way JavaScript's encodeURIComponent does, which is right for a single query value.
In code
import base64, urllib.parse
base64.b64encode("Hello".encode()).decode() # 'SGVsbG8='
base64.b64decode("SGVsbG8=").decode() # 'Hello'
urllib.parse.quote("10 kΩ", safe="") # '10%20k%CE%A9'