What is Base64?
Base64 is an encoding that represents binary data using 64 printable ASCII characters (A–Z, a–z, 0–9, and + /). It is not encryption — it does not hide or protect data. Its purpose is to safely carry data through systems that only handle text, such as email, JSON, HTML data URIs, and HTTP headers.
Example
The text Hello, world! encodes to SGVsbG8sIHdvcmxkIQ==. Decoding that string returns the original text. The trailing = characters are padding that makes the length a multiple of four.
URL-safe Base64
Standard Base64 uses + and /, which have special meaning in URLs. The URL-safe variant replaces them with - and _ so the string can be used in query parameters and tokens (for example, in JSON Web Tokens). Toggle the checkbox above to switch alphabets.
Limitations
- Base64 increases data size by about 33%, so it is inefficient for large payloads.
- It provides no confidentiality. Anyone can decode it. To protect data, use real encryption such as our hashing tools for integrity or an AES tool for confidentiality.
- Decoding fails if the input is not valid Base64 (wrong characters or incorrect padding).
How to fix common problems
- “Invalid Base64” when decoding: remove stray spaces or line breaks, and check for missing
=padding. If the string came from a URL or JWT, enable the URL-safe option. - Garbled characters after decoding: the original data may not be UTF-8 text (it could be an image or binary file). This tool decodes to text.
- Unexpected
=signs: that is normal padding, not an error.