Developer Tools
Base64 Encode & Decode
Encode text to Base64 or decode it back, with URL-safe output and full Unicode support.
Enter text and press Encode or Decode.
What is Base64 encoding?
Base64 is a way of representing binary data as plain ASCII text, using 64 safe characters (A–Z, a–z, 0–9, +, /). It is used everywhere text-only channels must carry arbitrary data: embedding images in HTML or CSS, HTTP basic authentication, email attachments, data URLs, and tokens like JWTs. Encoding is fully reversible — decoding returns the exact original bytes. This tool encodes and decodes text with correct Unicode handling, plus a URL-safe variant that swaps + and / for - and _ so the output survives in URLs and filenames.
How to use this tool
- Type or paste your text into the input box.
- Tick URL-safe output if the result will go into a URL, filename, or JWT-style token.
- Press Encode to convert text to Base64, or paste Base64 and press Decode to get the original text back.
- Use Copy output to copy the result.
Key features
- Correct Unicode support: Urdu, emoji, and other non-ASCII text round-trips perfectly via UTF-8.
- URL-safe mode producing base64url output (no padding, - and _ alphabet) and decoding it back.
- Whitespace-tolerant decoding — pasted output with line breaks still decodes.
- Clear error message on invalid input instead of a cryptic browser exception.
- Everything runs locally in your browser; nothing is uploaded anywhere.
Common use cases
- Embedding small images or fonts directly in HTML/CSS as data URLs.
- Inspecting JWT tokens: the header and payload segments are base64url-encoded.
- HTTP Basic Auth: the username:password pair is sent Base64-encoded.
- Email: attachments and non-ASCII headers travel as Base64 in MIME messages.
- Debugging APIs that return binary payloads (PDFs, images) as Base64 strings.
Practical tips
- Base64 is encoding, not encryption — anyone can decode it, so never use it to "hide" passwords or secrets.
- Base64 output is about 33% larger than the input; it is a compatibility tool, not a compression tool.
- If decoding fails, check whether the source used URL-safe encoding and toggle the checkbox to match.
- The = padding at the end is optional in URL-safe mode but required by strict standard decoders.
- For files (not text), use your OS tools or code — this tool handles text input.
Frequently Asked Questions
Is Base64 encryption?
No. Base64 is a reversible encoding with no key — anyone can decode it instantly. It exists for compatibility with text-only systems, never for secrecy.
What is URL-safe Base64?
Standard Base64 uses + and /, which have special meanings in URLs. URL-safe (base64url) mode replaces them with - and _ and drops the = padding, so tokens work in links and filenames.
Why did my Urdu or emoji text break in another encoder?
Many naive encoders mishandle characters outside ASCII. This tool converts text to UTF-8 first, so any Unicode text encodes and decodes correctly.
Why is the output longer than my input?
Base64 packs 3 input bytes into 4 output characters, so output is roughly 33% larger. That overhead is the price of text-safe transport.
Does decoding validate the input?
Yes — characters outside the Base64 alphabet cause a clear error message instead of silently producing garbage, so you know when pasted text is corrupt.