What is Base64 Encoding?
Base64 is an encoding scheme used to represent binary data in an ASCII string format. It works by translating groups of 24 bits into 4 printable characters. This tool natively supports UTF-8 text encoding, meaning emojis and special characters will translate perfectly without throwing errors.
Why do developers use Base64?
- Data URLs: Easily embed images, fonts, or SVGs directly into your HTML and CSS to reduce HTTP requests.
- Text-only channels: HTTP Basic Authentication headers and email attachments (MIME) use Base64 so binary data can travel through systems built for text.
- API Payloads: Wrapping complex or binary data structures (like PDF streams or Image buffers) inside a standard JSON response.
Encoding images for CSS and HTML
Choose Encode a file or image to turn a PNG, SVG, icon or font into Base64. Pick Data URI for use in an src attribute, or CSS background-image to get a line you can paste into a stylesheet. Inlining suits small files such as icons; for large images a normal file is faster, because Base64 makes data about a third larger.
Decoding tips
The decoder accepts Base64 with line breaks, the URL-safe alphabet, missing padding and full data: URIs. If the decoded bytes are not readable text, for example an image or PDF, you can download them as a file instead.
Note: Base64 is an encoding format, not an encryption method. Never use Base64 to "hide" sensitive information or passwords, as it can be easily decoded by anyone.