Base64 Encoder/Decoder
Encode or decode Base64, UTF-8 safe - free, no signup.
What this tool does
Type or paste your text, choose Encode or Decode, and the result appears instantly. Text is converted to UTF-8 bytes before encoding, so accented letters and emoji round-trip correctly - a common bug in simpler tools that only handle plain ASCII. A URL-safe option swaps the characters that aren't safe in a URL or filename and strips the padding.
Encodes text to Base64 or decodes Base64 back to text, entirely in your browser.
Handles UTF-8 correctly, so emoji and accented characters encode and decode without corruption - many simple Base64 tools break on anything outside plain ASCII.
Offers a URL-safe variant (using - and _ instead of + and /, with padding stripped) for use in URLs, filenames or query strings.
Decodes either alphabet automatically and re-pads truncated input, so a token copied without its trailing = signs still decodes.
Shows live input and output character counts next to the result, useful for checking the roughly 4:3 size increase Base64 adds.
How to use it
- Paste or type your text.
- Choose Encode or Decode.
- Turn on URL-safe if the result needs to go in a URL or filename.
Why use this tool
Base64 turns binary or special-character data into plain text safe for emails, JSON and URLs. Encoding as UTF-8 first keeps accents and emoji intact, which naive tools corrupt.
Why we built it
We built the Base64 encoder and decoder to convert through UTF-8 bytes, so emoji and accented characters round-trip correctly instead of crashing. Decode tokens with the JWT decoder and escape URLs with the URL encoder and decoder.
Handy alongside this: the HTML Entity Encoder/Decoder, the Image to Base64 Converter and the Hash Generator.
Who this tool is for
- Developers handling tokens, data URIs and APIs
- Support staff decoding a string they were sent
- Students learning encodings
When to use it
- Putting data into JSON, HTML or a header.
- Reading a Base64 string from an API, token or log.
- Checking a value in a config file.
- Learning how Base64 works.
Why UTF-8 handling matters
The classic Base64 bug: it breaks the moment you try an emoji.
The browser's built-in btoa() function only accepts characters in the Latin-1 range and throws an error on anything else - which includes almost every emoji, most non-English accented letters, and any character outside the first 256 Unicode code points. A Base64 tool that doesn't handle this either crashes on that input or silently mangles it. This tool converts your text to UTF-8 bytes first, then Base64-encodes those bytes, which is the standard, correct approach and works for any text you throw at it.
Padding and the two Base64 alphabets
Two small details trip up hand-written decoders: padding and which 62nd/63rd characters are used.
Base64 packs input into groups of 3 bytes and outputs 4 characters per group; when the input isn't a multiple of 3 bytes, the output is padded with one or two trailing = characters so the length is always a multiple of 4. Standard Base64 uses + and / for its 62nd and 63rd characters, both of which need percent-encoding inside a URL - the URL-safe variant swaps those for - and _ and drops the = padding entirely, since the decoder can reconstruct it from the string length. This tool's decoder strips whitespace, converts - and _ back to + and /, and re-adds any missing = before decoding, so it accepts input from either alphabet whether or not the padding survived a copy-paste.
What you give it, and what you get back
| Item | Details |
|---|---|
| Input | Text to encode, or a Base64 string to decode. |
| Output | The converted text, copyable. |
| Notes | UTF-8 safe; padding is handled. |
Issues you may run into
| What you see | Why it happens | What to do |
|---|---|---|
| Decoding fails | Invalid characters, missing padding or a cut-off string. | Remove spaces and quotes and check the length. |
| Output looks garbled | The data was a file, not text. | Use a file-based Base64 tool. |
| Result is longer | Base64 adds about a third. | This is normal. |
Assumptions and limitations
- This encodes and decodes text, not binary files - for encoding an image or document to Base64, you'd need a tool built for file input.
- Decoding requires valid Base64 input; stray characters or missing padding will be reported as an error rather than guessed at.
Frequently asked questions
How do I encode text to Base64 online for free?
Paste or type your text, make sure Encode mode is selected, and the result appears instantly. No signup, no upload.
Why does my emoji or accented text look broken in other Base64 tools?
Many tools use the browser's basic btoa() function directly, which only supports plain ASCII-range characters and corrupts or crashes on anything else. This tool converts to UTF-8 bytes first, so any text encodes and decodes correctly.
What is URL-safe Base64?
A variant that replaces the + and / characters (which have special meaning in URLs) with - and _, and removes the trailing = padding - safe to use directly in a URL, query string or filename.
Can I decode Base64 that was encoded somewhere else?
Yes - paste it in Decode mode. If it was encoded with the standard alphabet or the URL-safe alphabet, this tool reads either.
Is my text uploaded anywhere?
No. Encoding and decoding happen entirely in your browser - nothing is sent to a server, and closing the tab clears it.
Do I need to include the = padding when decoding?
No. Missing trailing = padding is added back automatically before decoding, so a token copied without it still works - as long as the remaining characters are valid Base64.
Why is the encoded output longer than my original text?
Base64 represents every 3 bytes of input as 4 output characters, so encoded text is roughly a third longer than the UTF-8 byte length of the original - not the character count, since multi-byte characters like emoji take more bytes.