Base64 Encode and Decode guide
Base64 Encode and Decode: Convert Text Online
Use our Base64 encoder and decoder to turn text into Base64 or decode Base64 back to text, with UTF-8 and URL-safe support.
By the AllCalculator editorial teamUpdated 16 October 20261 min read
Base64 is a way of writing any data using only letters, numbers and a couple of symbols. It's used in emails, web pages, APIs and configuration files. Our Base64 Encode and Decode tool converts text both ways.
How to use the calculator (Base64 Encode and Decode)
- Choose encode or decode.
- Type or paste your text.
- Choose the URL-safe alphabet if the result will go in a web address.
The full result appears in a box you can copy.
How Base64 works
Base64 takes your data 3 bytes at a time and splits those 24 bits into four 6-bit groups. Each group becomes one of 64 characters: A–Z, a–z, 0–9, + and /. If the data doesn't divide into 3 bytes evenly, = signs pad the end.
So Base64 is always about a third longer than the original.
A worked example
With the calculator's default settings, Hello, AllCalculator! (21 bytes) encodes to:
SGVsbG8sIEFsbENhbGN1bGF0b3Ih (28 characters)
URL-safe Base64
The + and / characters have special meanings in URLs, so the URL-safe version uses - and _ instead, and usually drops the = padding.
Frequently asked questions
Is Base64 encryption?
No. Anyone can decode it. Never use it to hide passwords or sensitive data.
Does it work with accents and emoji?
Yes. Text is converted to UTF-8 before encoding.
Is my text sent anywhere?
No. It's converted in your browser.
For encoding text in web addresses, use our URL Encode and Decode tool.
Sources and further reading
Links open official and independent websites in a new tab.
This guide is general information to help you understand your options. It isn't financial, tax, legal or building advice and doesn't take your personal circumstances into account. Figures were checked when the guide was last updated and can change, so confirm anything important with GOV.UK, HMRC, a regulated adviser or a qualified tradesperson.