Base64 Encoder & Decoder
Convert text to Base64 or decode a Base64 string back to readable text. Text is handled as UTF-8, so accented letters, emoji and non-Latin scripts work correctly.
Your input stays in your browser and is not sent to a server by this page.
What it is and when to use it
Base64 represents data using only 64 safe text characters. You see it in data URIs, email attachments, HTTP Basic authentication headers and the segments of a JWT. Use this tool to encode text for those places, or to decode a Base64 string you received and see what it contains.
How to use
- Enter text in the input box.
- Select Encode to produce Base64, or Decode to read Base64.
- Tick URL-safe if the result is used in a URL or token.
- Copy the result.
Example
Hello, 你好
SGVsbG8sIOS9oOWlvQ==
Tips and common mistakes
- Base64 is encoding, not encryption. Anyone can decode it, so never use it to hide passwords or secrets.
- Encoded output is about one third larger than the original, because every 3 bytes become 4 characters.
- URL-safe Base64, used in JWTs, replaces
+and/with-and_and often drops the trailing=padding. Convert these characters back before decoding standard Base64. - If decoded text looks garbled, the original data was probably binary (an image or a file) rather than UTF-8 text.
Frequently asked questions
Is Base64 encryption?
No. Base64 is only an encoding. Anyone can decode it, so never use it to protect secrets.
Why does decoding sometimes fail?
The input may contain characters outside the Base64 alphabet, have an impossible length, or decode to bytes that are not UTF-8 text (for example, an image).
Does it accept data URLs?
Yes. A leading data:...;base64, prefix is removed before decoding. Only text results are shown.