Base64 Encoder and Decoder
Convert text to Base64 and Base64 back to text. UTF-8, emoji and URL-safe Base64 are all supported.
Characters: 0Words: 0Lines: 0
How Base64 works
Base64 takes your data three bytes at a time and writes it as four characters from a set of 64 safe ones: A to Z, a to z, 0 to 9, + and /. If the data does not divide evenly, one or two = signs are added as padding. For example, "Hello, World!" becomes SGVsbG8sIFdvcmxkIQ==.
Because every three bytes become four characters, Base64 text is about one third larger than the original data.
Where Base64 is used
- Embedding small images in web pages and CSS as data URIs.
- Sending binary attachments in email (MIME).
- Putting data inside JSON, XML or web addresses.
- HTTP Basic authentication headers and JSON Web Tokens (JWT), which use the URL-safe form.
Encode and decode in code
- JavaScript (browser): btoa(text) to encode and atob(base64) to decode. For non-English text, convert to UTF-8 first, as this tool does.
- Python: base64.b64encode(data) and base64.b64decode(text).
- Linux and Mac terminal: echo -n "text" | base64 and base64 --decode.
- PowerShell: [Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes("text")).
Base64 is not security
Base64 only changes how data is written. It does not hide it, and anyone can decode it in a second. If you need secrecy, use real encryption.
How to use the Base64 Encode / Decode tool
- Paste your text, or a Base64 string you want to read, into the box.
- Click Encode to Base64, Encode (URL-safe) or Decode from Base64.
- Click the copy icon above the text to use the result.
Frequently asked questions
What is Base64?
Base64 is a way to write any data using only 64 safe characters (A-Z, a-z, 0-9, + and /). It lets binary data travel through systems that only handle text, such as email and JSON.
Is Base64 encryption?
No. Base64 is an encoding, not encryption, and anyone can decode it. Never use it to hide passwords or secrets.
What is URL-safe Base64?
URL-safe Base64 replaces + with - and / with _ and usually drops the = padding, so the result can sit inside a web address or file name without changes.
Why does my Base64 end with = signs?
The = characters are padding that bring the length to a multiple of four. This tool can decode Base64 with or without them.
Does it work with emoji and non-English text?
Yes. Text is converted to UTF-8 first, so accents, other alphabets and emoji encode and decode correctly.