How to use the base64 encode and decode
- Choose Encode to Base64 to turn text into Base64, or Decode from Base64 to turn it back into text.
- Paste or type your text in the first box. The result appears in the second box as you type.
- For encoding, pick the options you need: the URL safe alphabet, = padding and line breaks at 76 characters.
- Press Copy result, or Use the result as input to run the output back through the other direction.
Formula
Text is converted to UTF-8 bytes
Every 3 bytes (24 bits) become 4 characters, each standing for 6 bits from the alphabet A-Z a-z 0-9 + /
The URL safe alphabet uses - and _ instead of + and /
Padding with = fills the last group to 4 characters
Base64 makes data about one third larger. It is an encoding, not encryption, and anyone can decode it.
Worked example
The text Hello, SumPanda! encodes to SGVsbG8sIFN1bVBhbmRhIQ==. The text abc becomes YWJj, and a becomes YQ==.
Text with other characters works through UTF-8: héllo € 😀 encodes to aMOpbGxvIOKCrCDwn5iA. The characters ??? followed by >>> encode to Pz8/Pj4+ in standard Base64 and Pz8_Pj4- in the URL safe form.
What Base64 is for
Base64 lets binary or special characters travel through systems that only handle plain text, such as email, JSON fields, data URLs and some web tokens. It is not a way to hide anything. Do not put secrets in Base64 and think they are protected.
Standard and URL safe forms
The standard alphabet uses plus and slash, which have special meanings in URLs. The URL safe form swaps them for hyphen and underscore, and padding is often dropped. The decoder accepts both forms, with or without padding and with line breaks, so you can paste values from many sources. For structured data see the JSON viewer, and for text changes see the case converter.
What the decoder cannot show
This tool decodes to text. If the Base64 holds an image, a PDF or other binary data, the bytes are not valid text and the tool tells you so instead of showing garbage. Everything runs in your browser and nothing is uploaded, and input beyond 2 million characters is refused to keep the page responsive. To convert timestamps in a token, try the Unix timestamp converter.
Assumptions and limits
- Text is encoded and decoded as UTF-8.
- Decoded bytes that are not valid UTF-8 text are reported as an error, not shown.
- Whitespace in Base64 input is ignored, and padding is optional when decoding.
- Files are not handled here. The tool is for text only, with a size limit of 2 million characters.
Frequently asked questions
How do I decode Base64?
Choose Decode, paste the Base64 text and read the result. The tool accepts standard and URL safe forms, with or without padding and with line breaks.
Is Base64 encryption?
No. It is a reversible encoding that anyone can undo, so it does not protect data. Use real encryption for anything private.
Why does my Base64 end with equals signs?
They are padding that fills the last group to four characters when the input length is not a multiple of three bytes. URL safe forms often omit them.
What does URL safe Base64 mean?
It swaps plus and slash for hyphen and underscore so the text can sit in a URL or a file name without being altered.