Base64 vs Base64URL
Why do three question marks encode as either Pz8/ or Pz8_? Compare the alphabets, check when the equals sign matters and see what happens to a plus sign in a query parameter.
Why does a token stop working in a link? Does a data URL contain the image it claims? These two guides follow short examples from the visible characters to the bytes they represent.
To try the first guide, compare Pz8/ with Pz8_ in the byte comparison tool. The result is a match of three bytes. For the second, paste data:text/plain;base64,SGk= into the inspector and look for the bytes 48 69. The articles below explain each result.
Why do three question marks encode as either Pz8/ or Pz8_? Compare the alphabets, check when the equals sign matters and see what happens to a plus sign in a query parameter.
A data URL that declares image/png can hold just two bytes of text. Separate the header from the data, decode the bytes and check the file type before saving.