How to encode or decode Base64
- Choose Encode or Decode.
- Type or paste your text or Base64 string. The result appears as you type.
- Tick URL-safe if the result will be used in a URL, filename or token.
- Copy the result, or click Swap to reverse the operation.
What is Base64?
Base64 represents any data using 64 safe characters: A–Z, a–z, 0–9, plus + and /, with = for padding. It’s used to send data through systems that only handle text, such as email attachments, data URLs, JSON APIs and HTTP authentication headers. Base64 is an encoding, not encryption: anyone can decode it, so never use it to hide passwords or secrets.
Simple Base64 tools often break on characters outside basic English. This tool first converts text to UTF-8 bytes, so “café”, “日本語” and emoji encode and decode correctly. When decoding, it accepts standard and URL-safe Base64, ignores spaces and line breaks, adds missing padding, and accepts a full data URL. It also detects when the decoded result is binary data, such as an image, rather than readable text, and tells you instead of showing garbled characters.
Where you’ll meet Base64
- Reading the payload of a JWT token (each part is URL-safe Base64).
- Debugging Basic authentication headers.
- Encoding data for URLs, cookies or configuration files.
- Inspecting Base64 strings in API responses and emails.
Base64 FAQ
Is Base64 secure?
No. It’s a reversible encoding with no key. Use encryption for anything sensitive.
What is URL-safe Base64?
It replaces + with - and / with _ and drops padding, so the text can be used in URLs without escaping.
Why is the output longer than the input?
Base64 uses 4 characters for every 3 bytes, so it’s about 33% larger.