Text Tools
Base64 Encoder & Decoder
Encode text to Base64 or decode Base64 strings back to text, with full UTF-8 and emoji support.
About the Base64 Encoder & Decoder
Base64 writes any data using only 64 safe, printable characters, so it can travel through systems designed for plain text. This tool encodes text to Base64 and decodes it back as you type, with full support for any language and emoji, an optional URL-safe mode and a size comparison.
What you can do with the Base64 Encoder & Decoder
- Encode and decode: Converts as you type, in either direction.
- Every language and emoji: Full UTF-8 support, so nothing gets garbled.
- URL-safe mode: Swap + and / for - and _ when the result goes in a link.
- Size comparison: See how much bigger Base64 makes your data.
Full support for any language and emoji
The browser's basic Base64 function fails on characters outside the Latin alphabet. This tool converts your text to UTF-8 bytes first, so accented letters, non-English scripts and emoji encode and decode correctly.
Why the result is longer
Every 3 bytes of input become 4 Base64 characters, so encoded text is about a third larger than the original. The Input and Output boxes show the exact sizes.
Base64 vs Base64URL
Web tokens such as JWTs use a URL-safe variant that swaps "+" for "-" and "/" for "_" and drops the "=" padding. Switch on "URL-safe" to encode that way; the decoder reads both forms automatically.
It is not encryption
Anyone can decode Base64 instantly, no key or password is involved. Never use it to "hide" passwords or private data.
Related tools
Frequently Asked Questions
What do the = signs at the end mean?
They are padding. Base64 works in groups of 4 characters, and one or two = signs fill the last group when the input length isn't a multiple of 3 bytes.
Why does it say the text is not valid Base64?
The input has characters outside the Base64 alphabet, or it decodes to binary data (like an image) rather than text. Remove any extra characters and check you copied the whole string.
Can I encode an image to Base64?
Yes, use the Image to Base64 tool, which reads the image file and gives you a data URL you can paste into HTML or CSS.
Why does Base64 make data about 33% bigger?
Base64 writes every 3 bytes as 4 characters, so the output is about four-thirds of the input size, plus up to two = signs of padding. The Input and Output boxes show the exact sizes and the percentage increase for your text.
Is Base64 a safe way to hide a password?
No. Base64 is an encoding, not encryption, and anyone can decode it in a second. For example, user:pass encodes to dXNlcjpwYXNz, which decodes straight back. Use proper encryption or hashing for anything secret.
What is "Hello" in Base64?
"Hello" encodes to SGVsbG8=. The five bytes do not divide evenly into groups of three, so one = is added as padding. "Hi" gives SGk= for the same reason. With URL-safe mode on, the = padding is left out.
When should I use URL-safe Base64?
Use it when the result goes into a web address, file name or token such as a JWT. Normal Base64 uses + and /, which have special meaning in URLs. URL-safe mode writes them as - and _ and drops the = padding.
Why does Hindi text become so long in Base64?
Base64 works on UTF-8 bytes, and most Devanagari characters take 3 bytes each. नमस्ते is 6 characters but 18 bytes, which becomes 24 Base64 characters: 4KSo4KSu4KS44KWN4KSk4KWH. English letters take just 1 byte each.
Can I decode Base64 that has line breaks in it?
Yes. Spaces and line breaks are removed before decoding, so Base64 copied from emails or files that wrap it every 76 characters works as is. Missing = padding at the end is added back automatically.
How do I decode a JWT token?
A JWT has three parts separated by dots. Paste only the first or second part, not the whole token, into Decode mode to read the header or the payload as JSON. The third part is a signature and does not decode to readable text.
How do I check an encoding by decoding it back?
Tap "Swap: use result as input". The result moves into the input box and the tool switches between Encode and Decode, so you see your original text again. It works in both directions.
Read the guide
Related tools
- Text to URL Slug, Turn a title into a clean, lowercase, hyphenated URL slug that search engines read well.
- Number to Words, Spell out any number in English words, e.g. 1,234 becomes one thousand two hundred thirty-four.
- Case Converter, Convert text to UPPERCASE, lowercase, Title Case, Sentence case, camelCase, PascalCase, snake_case or kebab-case.
- Text Cleaner, Clean messy pasted text with switchable rules: trim spaces, remove blank or duplicate lines, strip HTML, bullets and emojis, straighten quotes or join lines.
- Sort Lines, Sort a list alphabetically A→Z or Z→A, or numerically from smallest to largest, ignoring upper/lower case.
- Morse Code Translator, Translate text to International Morse code and decode dots and dashes back into letters.