How Base64 encoding works
This Base64 converter follows the standard: it takes the data three bytes at a time, splits those 24 bits into four groups of six bits and writes each group as one of 64 characters. The result is about a third larger than the original, and = signs pad the end when the length is not a multiple of three. Text is first turned into bytes with UTF-8, so accented letters, emoji and every script come back exactly as they were.
| Text | Base64 |
|---|---|
| Hello | SGVsbG8= |
| Hello, world! | SGVsbG8sIHdvcmxkIQ== |
| Grüße | R3LDvMOfZQ== |
| user:pass | dXNlcjpwYXNz |
Where you meet Base64
- Data URIs: small images and fonts embedded straight into HTML or CSS, like data:image/png;base64,iVBOR…
- APIs and JSON: files sent inside JSON fields, and the user:password pair in a Basic authorization header.
- JWT tokens: the header and payload of a JSON Web Token are URL safe Base64. Paste a whole token in Decode mode to see both as JSON, or open it in the JWT decoder for readable claim dates and a signature check.
- Email: attachments travel as Base64 with a line break every 76 characters.
How to encode and decode Base64
- 1Choose Encode or Decode. To encode a file instead of text, use Encode a file.
- 2Type or paste your input. The result updates as you type.
- 3Copy the result, copy it as a data URI, or download the decoded file.
Frequently asked questions
What is Base64?
Base64 writes any data, text or binary, using only 64 safe characters: A to Z, a to z, 0 to 9, plus and slash, with = as padding. It is used where only plain text can travel, like email attachments, JSON fields, data URIs in HTML and CSS, and authorization headers.
Is Base64 encryption?
No. Base64 is an encoding, not encryption. Anyone can decode it in a second, so never use it to hide passwords or secrets. It only makes data safe to transport as text.
What is URL safe Base64?
Plus and slash have special meanings in URLs, so the URL safe variant uses minus and underscore instead and usually drops the = padding. It is used in JWT tokens, URL parameters and file names. The decoder here reads both variants.
Why does my decoded text show strange characters?
The text was probably encoded with a different character set, or the Base64 is really a file such as an image or a PDF. This tool decodes text as UTF-8. If the result is a file, it detects the type and offers it as a download.
Are my files and text uploaded?
No. Encoding and decoding run in your browser. Your text, files and tokens stay on your device.