Base64 encoding and decoding: what it is and how to do it
Base64 turns bytes into plain letters and digits so they can travel through systems that only handle text, such as email, JSON or URLs. Base64 encode/decode converts both ways.
Steps
- Paste your text.
- Pick the Direction: encode or decode.
- Optionally tick the URL-safe alphabet, which uses
-and_and drops the=padding. - Copy the result.
Example
abc encodes to YWJj. Decoding YWJj returns abc. Text with accents, Hindi or emoji works too because the tool encodes it as UTF-8 first.
Base64 is not encryption
Anyone can decode Base64 in seconds. It hides nothing. Never use it to protect passwords or secrets.
When to use URL-safe
Standard Base64 includes +, / and =, which have special meanings in URLs. JSON Web Tokens use the URL-safe form; see JWT explained.
Common errors
- “Invalid input” when decoding usually means extra characters, such as spaces or quotes, or a URL-safe string decoded in standard mode.
- Garbled text after decoding often means the data was not text at all (for example an image).
Related
For percent-encoding in web addresses, use URL encode/decode.