Base64 encoder & decoder
Encode UTF-8 text as Base64 or decode it back to text. Base64 is encoding, not encryption.
Input
Tip: press Ctrl + Enter to run
Saved settings
About this tool
Base64 represents bytes using 64 safe characters, so binary data or non-ASCII text can travel through systems that expect plain text: email attachments, data URLs, HTTP basic authentication headers and many APIs. This tool encodes text as UTF-8 and then Base64, or decodes Base64 back to readable text.
Base64 is not encryption. Anyone can decode it, so never treat a Base64 string as hidden or secure.
How to use it
- Paste the text to encode, or the Base64 string to decode.
- Choose encode or decode.
- Run the tool.
- Copy the result. For images, use image to Base64 instead.
How the calculation works
Encoding converts the text to UTF-8 bytes and then to standard Base64 with padding. Decoding removes whitespace, checks the Base64 format and decodes the bytes as strict UTF-8, refusing invalid byte sequences.
UTF-8 ⇄ Base64Worked example
Encoding "Café €5" produces Q2Fmw6kg4oKsNQ==. The accented é and the euro sign take two and three bytes in UTF-8, which is why the result is longer than the seven visible characters suggest, and the two = signs pad it to a multiple of four. Decoding Q2Fmw6kg4oKsNQ== returns Café €5.
Sample input and result
Hello → SGVsbG8=
Limitations
- Text only; binary output is refused when decoding.
- Standard alphabet with padding.
- Up to 100,000 characters.
Last updated:
Frequently asked questions
Is Base64 secure?
No. It is an encoding that anyone can reverse instantly.
Does it support Base64URL (with - and _)?
It uses standard Base64 with + and /. For Base64URL, replace - with + and _ with /, and add = padding before decoding.
Why does decoding fail on some strings?
The string may not be valid Base64, or it may encode binary data (such as an image) that is not UTF-8 text.
Troubleshooting
Decoding gives an error for a JWT segment.
JWTs use Base64URL without padding. Use the JWT decoder.
A data URL will not decode.
Remove the "data:...;base64," prefix and decode only the part after the comma.
Line breaks in the Base64 cause problems.
Whitespace is removed automatically before decoding; check for other characters such as quotes.
Privacy & Free to use
Are my inputs stored?
Your inputs stay in this tab. We do not receive your files, pasted text or calculation values.
Is this tool free?
Yes. No signup or payment is required.
See also
Useful next steps
JSON formatter & validator
Validate, pretty-print or minify JSON locally. Invalid data is never sent to a server.
Developer & SEOCSV to JSON converter
Convert CSV headers and records to JSON, supporting quoted delimiters and line breaks.
Developer & SEOJSON to CSV converter
Convert a flat array of objects to CSV. Formula-like strings receive a protective prefix for spreadsheet imports.
Developer & SEO