Encode plain text to Base64 or decode Base64 back to plain text.
Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format. It converts arbitrary bytes into a set of 64 printable characters (A–Z, a–z, 0–9, +, /). This makes it possible to safely transmit data over text-only channels such as email (MIME), JSON APIs, and HTML attributes without corruption from control characters.
Common real-world uses include embedding images directly in HTML or CSS as data URLs, storing binary data in JSON payloads, encoding credentials in HTTP Basic Authentication headers, and transmitting email attachments. Developers also use Base64 when they need to store binary blobs in databases that only accept text. Decoding reverses the process — useful when you receive a Base64 string and need the original content.
btoa() / atob() API — nothing is sent to a server.<img src="data:image/png;base64,iVBOR...">. This eliminates an HTTP request for the image but increases HTML file size.