Base64 Encoder & Decoder - Text and Files, UTF-8 Safe
Base64 shows up everywhere: API payloads, email attachments, data URIs, basic-auth headers and JWT parts. The catch with many quick encoders is that they break on non-English text. This one encodes the UTF-8 bytes of your text, so anything you can type survives the round trip.
File to Base64
Choose a file to get its Base64 data string (useful for data URIs and test payloads). The file is read locally - it is never uploaded.
How to use the Base64 Encoder & Decoder
- Type or paste your text (or pick a file for file-to-Base64).
- Optionally tick URL-safe if the result goes into a URL or a JWT.
- Click Encode or Decode and copy or download the result.
How it works
Base64 represents every 3 bytes of data as 4 characters from a 64-character alphabet, which makes binary data safe to carry inside text formats like JSON, XML and URLs. This tool first converts your text to its UTF-8 bytes (the universal encoding for text), then encodes those bytes - which is why accented letters, Arabic-script text and emoji all decode back perfectly. The URL-safe variant swaps + and / for - and _ and drops the = padding, exactly as used in JSON Web Tokens.
Worked example
The text "Loona" encodes to TG9vbmE=. The greeting "Assalam-o-Alaikum" with Urdu script and an emoji - السلام علیكم 👋 - encodes and decodes back letter-for-letter, which naive encoders that only handle plain ASCII cannot do.
Frequently Asked Questions
Is this Base64 tool free?
Yes - free, no sign-up, no limits.
Why do some Base64 tools garble non-English text?
They encode each character as a single byte, which only works for plain ASCII. This tool encodes the UTF-8 bytes instead, so every language and emoji round-trips exactly.
What is the URL-safe option?
Standard Base64 can contain + and /, which are special characters in URLs. The URL-safe alphabet replaces them with - and _ and removes padding - the variant used in JWTs.
Is Base64 encryption?
No. Base64 is an encoding, not encryption - anyone can decode it instantly. Never use it to protect secrets.
Are my files uploaded?
No. Files are read by your browser on your device and never leave it.