Base64 Encode / DecodeFree online other calculator — instant results, no sign-up
Encode text to Base64 or decode it back.
About the Base64 Encode / Decode
This tool encodes plain text into standard Base64 representation and attempts to decode valid Base64 strings back to text. It is used by web developers, data engineers, and system administrators to safely transmit or inspect binary-safe ASCII text in web environments and data payloads.
- Text
- The plain text string or Base64-encoded string you want to convert; supports multi-line text and UTF-8 characters
Formula and method
Encoded = btoa(unescape(encodeURIComponent(Text))); Decoded = decodeURIComponent(escape(atob(Text)))
- encodeURIComponentEncodes text characters into UTF-8 percent-encoded byte sequences
- unescape / escapeLegacy functions used here to convert byte sequences between UTF-8 and binary string formats
- btoaConverts binary string data into Base64 ASCII text
- atobDecodes a Base64 ASCII string back into a binary string
The tool processes the input simultaneously in two directions. For encoding, it converts UTF-8 characters to percent-encoded bytes, unescapes them into a binary string, and applies the standard Base64 algorithm. For decoding, it attempts to parse the input with Base64 decoding; if the input is not a valid Base64 string, it catches the error and outputs a dash.
Worked example
These are the calculator's starting values and the results it actually produces for them.
Inputs
- TextHello, Calculty!
Results
- EncodedSGVsbG8sIENhbGN1bHR5IQ==
- Decoded (if input was Base64)—
How to use the Base64 Encode / Decode
- 1Take the input string from the Text area.
- 2Percent-encode any multibyte UTF-8 characters and transform them to binary byte strings.
- 3Apply Base64 encoding to produce the Encoded field.
- 4Attempt Base64 decoding on the original input; return the decoded text if valid, or a dash (—) if decoding fails.
Reading your result
The 'Encoded' row shows the Base64 representation of whatever string was provided. The 'Decoded (if input was Base64)' row displays the original decoded text if your input was a valid Base64 string; if your input was plain text or an invalid format, it displays '—'.
Limitations
This tool operates on textual input and does not accept direct binary file uploads like raw images or audio. It assumes standard RFC 4648 Base64 padding (=) and alphabet, rather than URL-safe Base64 variants (which replace + and / with - and _).
Common questions
Why does the Decoded field show a dash (—)?+
A dash indicates the input text is not a valid Base64 sequence or cannot be properly converted back into valid UTF-8 characters.
Does this tool handle Unicode characters and emojis?+
Yes. The implementation uses UTF-8 percent-encoding wrappers before Base64 conversion, ensuring non-ASCII and multibyte characters encode and decode correctly without throwing Latin-1 range errors.
Is Base64 a form of encryption?+
No. Base64 is an encoding format designed to make binary data safe for text-only protocols like email or JSON. It does not hide or secure data, as anyone can decode it instantly.
Does the calculator save my information?+
Calculations run in your browser. While signed in, inputs and results are automatically recorded in account history; saving a result creates a separate saved record.
You might also like
IP Subnet Calculator
Network, broadcast and host range of an IPv4 subnet.
Password Generator
Create a strong random password.
Voltage Drop Calculator
Voltage drop on a copper conductor.
GDP Calculator
GDP by the expenditure approach.
Horsepower Calculator
Horsepower from torque and RPM.
Engine Horsepower Calculator
Estimate horsepower from weight and quarter-mile time.
Results are estimates for informational purposes and are not financial, medical or legal advice.