This tool converts text to Base64 and back. It handles UTF-8 correctly, offers the URL-safe alphabet for tokens and file names, and reports invalid input instead of returning broken characters.
Your data is processed locally in your browser and is not uploaded to our server.
How to use this tool
1 Choose whether you want to encode text or decode Base64.
2 Paste the text or Base64 string into the input box; the result appears as you type.
3 Enable “URL-safe” to use - and _ instead of + and / and to omit padding.
4 Copy the result, swap the direction, or clear both boxes.
Formula and calculation logic
Encoding
Text → UTF-8 bytes → 6-bit groups → Base64 alphabet
Each three bytes become four Base64 characters. A final group of one or two bytes is padded with =, unless the URL-safe variant is selected.
URL-safe Base64
+ → -; / → _; padding removed
Standard Base64 uses + and /, which have meaning in URLs. The URL-safe variant substitutes - and _ and drops trailing = so the value can be placed in a query string or file name.
Worked example
Encoding a sentence
A short text needs to travel inside a JSON string.
Input: Hello, 1123.net!
UTF-8 bytes are encoded in groups of three
Result: SGVsbG8sIDExMjMubmV0IQ==
Decoding the result returns the original sentence exactly, including punctuation.
URL-safe token
A Base64 value will be used in a URL query parameter.
Enable “URL-safe”
+ becomes - and / becomes _
Trailing = padding is omitted
The output contains no characters that need percent-encoding in a URL.
Edge cases and accuracy
Base64 is not encryption
Anyone can decode Base64. It only represents bytes in text form and must not be used to protect passwords or secrets.
Not every Base64 decodes to text
Base64 can represent arbitrary binary data. If the bytes are not valid UTF-8, the decoder reports an error rather than showing replacement characters.
Line breaks and padding
Whitespace is ignored when decoding, and missing padding is accepted. Invalid characters or an impossible length are rejected.
Frequently asked questions
Is Base64 secure?+−
No. Base64 is an encoding, not encryption, and provides no confidentiality. Use encryption for secrets and Base64 only for transporting bytes in text.
Why does URL-safe Base64 omit the equals signs?+−
Padding is optional for many decoders and = can be awkward in URLs. The URL-safe variant removes it while keeping the data unchanged.
Does it support emoji and non-Latin text?+−
Yes. Text is encoded as UTF-8 first, so emoji, Chinese, Cyrillic and accented characters round-trip correctly.
Why does decoding fail on valid-looking Base64?+−
The bytes may not be valid UTF-8 text, or the string may contain a character outside the Base64 alphabet. Binary payloads need a file or hex tool instead.
Is my text uploaded?+−
No. Encoding and decoding happen entirely in your browser, and nothing is sent to a server.
Related developer tools
Format JSON, generate identifiers or encode URLs for the same payload.