Base64 encoder and decoder
Convert text to Base64 or decode Base64 back to readable text, with correct UTF-8 handling for accents and emoji. Everything runs in your browser and nothing is uploaded.
How to use it
- Type or paste your text (or a Base64 string) in the box.
- Leave Direction on Auto-detect, or choose to encode or decode yourself.
- Tick URL-safe Base64 if you need the variant used in URLs and tokens.
- Click Copy to use the result.
Complete guide to Base64 encoding and decoding
What Base64 is for
Base64 writes any sequence of bytes using only 64 safe characters: the letters A to Z and a to z, the digits 0 to 9, plus + and /. That makes binary data or text with special characters safe to travel through systems built for plain text, such as e-mail bodies, JSON fields, HTML attributes, URLs and HTTP headers. You meet it in data URIs, in the three parts of a JWT, in basic authentication headers and in API payloads.
It is an encoding, not encryption. Anyone can reverse it in one step, so it hides nothing.
How it works
The text is first converted to bytes with UTF-8, so accents, non-Latin letters and emoji are handled correctly. The bytes are then read in groups of three (24 bits) and cut into four pieces of 6 bits, and each piece becomes one character from the alphabet. When the last group has fewer than three bytes, one or two = signs are added as padding. The result is always about one third larger than the original: 3 bytes become 4 characters.
Worked example
- Type
Hello, World!in Your text, set Direction to Encode to Base64. The Result isSGVsbG8sIFdvcmxkIQ==. The two=signs are padding. - Paste that result back with Direction on Auto-detect. The Operation line reads Decoded from Base64 and the text returns to
Hello, World!. - Encode
Olá, mundo: the result isT2zDoSwgbXVuZG8=. The letter "á" takes two UTF-8 bytes, which is why the output is longer than you might expect. - Tick URL-safe Base64 (- and _ instead of + and /, no padding) and encode
???>>>: you getPz8_Pj4-instead of the standardPz8/Pj4+.
Standard and URL-safe alphabets
| Variant | Characters 62 and 63 | Padding | Typical use |
|---|---|---|---|
| Standard | + and / | Uses = | E-mail, data URIs, most APIs |
| URL-safe | - and _ | Removed | JWT, URLs, file names |
When decoding, both forms are accepted, and spaces or line breaks inside the text are ignored.
Tips and common mistakes
- Auto-detect decodes only when the input is valid Base64 that turns into readable UTF-8. Input with spaces, such as a normal sentence, is encoded. If a short single word happens to look like Base64, choose the direction yourself.
- If you see the message that the Base64 is valid but does not decode to UTF-8 text, the data is binary, such as an image or a PDF. This tool works with text; for pictures use the image to Base64 converter.
- An "not valid Base64" error usually means a stray character, a truncated string or a missing part. Copy the whole value again.
- Never use Base64 to hide passwords or keys. Treat an encoded value as readable.
Related tools
To read the parts of a token use the JWT decoder. For text safe inside web addresses use the URL encoder and decoder, and for fingerprints of text use the hash generator. Conversion runs in your browser and nothing is uploaded.
Questions
Is Base64 encryption?
No. Base64 is only a way to write bytes using plain characters. Anyone can decode it, so never use it to protect secrets.
Does it work with accents and emoji?
Yes. Text is converted as UTF-8 before encoding, so characters like é, ç, 你 and emoji survive a round trip.
What is URL-safe Base64?
A variant that uses - and _ instead of + and / and drops the = padding, so the result can sit safely inside URLs, file names and JWT tokens. Decoding accepts both forms.
Why does auto-detect treat my text as plain text?
Auto-detect only decodes when the input is valid Base64 that turns into readable UTF-8 text. If a normal word happens to look like Base64, pick the direction manually.