About the Base64 Encoder / Decoder
Base64 is an encoding scheme that represents binary data using 64 printable ASCII characters. It is used everywhere: email attachments (MIME), data URIs in HTML and CSS, HTTP Basic authentication headers, JSON Web Tokens and storing binary data in text-only systems.
The Base64 Encoder / Decoder converts text in both directions instantly as you type. Unlike many simple tools, it fully supports UTF-8, so emojis, Urdu, Arabic, Chinese and accented characters encode and decode correctly. Enable URL-safe mode to produce base64url output (using - and _ instead of + and /, without padding), which is used in JWTs and URLs. When decoding, data URI prefixes and whitespace are removed automatically.
Worked examples: what Base64 looks like
Encoding the text Hello, world! gives:
SGVsbG8sIHdvcmxkIQ==
The two = signs at the end are padding: Base64 works in groups of three bytes, and padding fills the last group. Text with non-English letters works too. The word café becomes Y2Fmw6k= because é is stored as two bytes in UTF-8.
Where you meet Base64 in daily work
- Email attachments are sent as Base64 inside the message.
- Basic authentication: the header
Authorization: Basic …containsusername:passwordin Base64. That is why it must only be used over HTTPS. Base64 hides nothing. - Data URIs: small icons can be embedded directly in HTML or CSS as Base64.
- JWT tokens use the URL-safe variant, so switch that option on when you decode their parts.
Quick checks when decoding fails
Make sure the string was copied completely (Base64 length is normally a multiple of 4), remove any surrounding quotes, and if it contains - or _, enable URL-safe mode.
How to use the Base64 Encoder / Decoder
- Choose Encode or Decode.
- Type or paste your text or Base64 string.
- Enable URL-safe mode if you need base64url.
- Copy the result.
Frequently asked questions
Is Base64 encryption?
No. Base64 is only an encoding, and anyone can decode it. Never use it to protect passwords or secrets.
Why does decoding show strange characters?
The Base64 may represent binary data such as an image or file rather than text. Try our Image to Base64 tool for images.
What is base64url?
A variant of Base64 that replaces + with - and / with _ and omits = padding, making it safe to use inside URLs and filenames.
