Base64 Encoder & Decoder
Use this Base64 decoder and encoder to convert text to Base64 or decode a Base64 string back to readable text. It handles Unicode text such as emoji and Hindi correctly, and everything runs in your browser.
By DevCalcHub Editorial Team · Last updated:
How it works
Base64 encoding represents binary data as ASCII text using 64 printable characters, commonly used to embed data in URLs, JSON, or email attachments.
Example
Encoding a simple string:
How to use the Base64 encoder and decoder
- Paste your text or Base64 string into the input box.
- Choose Encode to convert text to Base64, or Decode to turn Base64 back into text.
- Copy the result. If a Base64 string is invalid, you will see an error instead.
How Base64 encoding works
Base64 turns any data into text using 64 safe characters: A–Z, a–z, 0–9, + and /. Every 3 bytes of input become 4 Base64 characters, so encoded data is about 33% larger than the original. When the input length isn't a multiple of 3, one or two = signs are added at the end as padding.
Text is first converted to UTF-8 bytes, so non-English text works too. For example, "नमस्ते" encodes to 4KSo4KSu4KS44KWN4KSk4KWH.
Common uses of Base64
- Data URIs — embedding small images or fonts directly in HTML or CSS.
- HTTP Basic authentication — the header is "Basic " followed by base64(username:password).
- Email attachments (MIME) and binary data inside JSON or XML.
- JSON Web Tokens (JWTs), which use a URL-safe Base64 variant.
Standard vs URL-safe Base64
URL-safe Base64 (base64url) replaces + with - and / with _, and often drops the = padding, so it can be used in URLs and file names. This tool uses the standard alphabet. To decode a base64url string — such as part of a JWT — replace - with +, _ with /, and add = until the length is a multiple of 4. For percent-encoding text in URLs, use the URL Encoder instead.
Frequently asked questions
What is Base64 used for?
Base64 is commonly used to embed binary data (like images) in text formats such as JSON or HTML, to encode email attachments, or to safely pass data in URLs.
Is Base64 encoding the same as encryption?
No. Base64 is an encoding scheme, not encryption — it's trivially reversible and provides no security. Never use it to protect sensitive data.
Why does Base64 end with = or ==?
The = signs are padding. Base64 works in groups of 3 bytes; when the last group has only 1 or 2 bytes, one or two = characters are added so the output length is a multiple of 4.
Does Base64 make data smaller?
No — it makes it about 33% larger. Base64 is for safely transporting binary data as text, not for compression.
Can I decode a JWT with this tool?
You can decode the header and payload parts after converting them from base64url to standard Base64 (replace - with +, _ with /, and add = padding). Never paste production tokens into tools you don't trust; this one runs entirely in your browser.
Related tools
Input
Output
SGVsbG8sIHdvcmxkIQ==