Convert plain text, code, and Unicode into standard or URL-Safe Base64 strings, or decode Base64 back into readable text. 100% private in-browser processing.
Encode arbitrary UTF-8 text into Base64 format or decode valid Base64 strings back to readable characters. Supports standard Base64 (RFC 4648), URL-safe variations (- and _), and custom line chunking.
Follow these 5 simple steps to convert plain text into Base64 format or decode encoded Base64 strings:
Click Encode to Base64 to convert plain text into a Base64 string, or click Decode Base64 to decode an existing Base64 string into readable text.
Type, paste, or upload your text or Base64 code into the left input textarea. Full Unicode, multi-line strings, and accented characters are supported.
Choose between Standard RFC 4648 (with + and /) or URL-Safe Base64 (with - and _), line wrapping (64/76 chars), and padding behavior.
With Live Auto-Process enabled, results calculate immediately as you type. Or click the primary Encode / Decode button to execute manually.
Click Copy to copy the output to your clipboard, or click Download to export the content as a base64-encoded.txt or base64-decoded.txt file.
Inspect the live statistics grid showing exact character counts, UTF-8 byte sizes, size expansion ratios (~133%), and padding counts.
Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format by translating it into radix-64 representation. Here is the mathematical process:
Base64 divides binary data into 6-bit chunks. Because computers store data in 8-bit bytes, the algorithm takes 3 input bytes (24 bits total) and divides them into 4 groups of 6 bits:
3 × 8 = 24 bits.4 characters.=) are added to complete the 4-character block.Standard Base64 uses characters that have reserved syntactic meaning in URLs and file systems:
+ (plus) and / (slash). In URLs, + can be interpreted as a space, and / as a path separator.+ with - (hyphen) and / with _ (underscore).Base64 is strictly a data representation format designed to safely transport binary data across media designed for text (such as email via SMTP or HTTP headers). It does not encrypt data and provides zero confidential protection. Anyone can decode a Base64 string in milliseconds without any secret key or password. Never use Base64 as a method to protect passwords, API keys, or sensitive customer records.
The 64 printable ASCII characters used to represent 6-bit binary values from 0 to 63:
| Value | Character | Value | Character | Value | Character | Value | Character |
|---|---|---|---|---|---|---|---|
0 | A | 16 | Q | 32 | g | 48 | w |
1 | B | 17 | R | 33 | h | 49 | x |
2 | C | 18 | S | 34 | i | 50 | y |
3 | D | 19 | T | 35 | j | 51 | z |
4 | E | 20 | U | 36 | k | 52 | 0 |
5 | F | 21 | V | 37 | l | 53 | 1 |
6 | G | 22 | W | 38 | m | 54 | 2 |
7 | H | 23 | X | 39 | n | 55 | 3 |
8 | I | 24 | Y | 40 | o | 56 | 4 |
9 | J | 25 | Z | 41 | p | 57 | 5 |
10 | K | 26 | a | 42 | q | 58 | 6 |
11 | L | 27 | b | 43 | r | 59 | 7 |
12 | M | 28 | c | 44 | s | 60 | 8 |
13 | N | 29 | d | 45 | t | 61 | 9 |
14 | O | 30 | e | 46 | u | 62 | + (or -) |
15 | P | 31 | f | 47 | v | 63 | / (or _) |
Authoritative answers to common questions regarding Base64 encoding, character sets, and standards:
==. If 2 bytes are left over, the output ends with =. If the input is an exact multiple of 3 bytes, no equals signs are added.
btoa() throws an exception when given non-ASCII characters. Our tool uses modern standard TextEncoder and TextDecoder to convert text into full UTF-8 byte streams before Base64 conversion. This guarantees flawless encoding and decoding of accented letters, Cyrillic, Arabic, Chinese, Japanese, Devnagari, and modern emojis.
+ and /, which have special syntax in URLs and query strings. URL-Safe Base64 (RFC 4648 §5) substitutes - (hyphen) for + and _ (underscore) for /, and often omits padding equals signs. This allows the string to be placed directly in web URLs without percent-encoding.
$, %, #), if the character count is not valid, or if the decoded binary bytes do not represent valid UTF-8 text (such as decoding a raw image or encrypted file as plain text).
%20) while leaving alphanumeric text unchanged. Base64 transforms the entire byte stream into an entirely new 6-bit representation.
Complement your development toolkit with these free online utilities: