Base64 Encoder / Decoder
Convert text or files to Base64, or decode Base64 back with automatic image detection.
📁 Or click to upload an image or file to convert to Base64
Supports PNG, JPG, SVG, WebP, GIF, PDF, TXT, and binary files up to 10MB
Understanding Base64 Encoding & Images
What is Base64?
Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format using 64 characters (A-Z, a-z, 0-9, +, /). It is widely used to embed images, stylesheets, or files directly into HTML, CSS, or JSON without separate HTTP requests.
Data URL Format for Images
To render a Base64 image directly in an HTML <img> tag or CSS background-image, the Base64 string must be prefixed with a Data URL scheme:
data:image/png;base64,iVBORw0KGgo...
Key Technical Considerations
33% Overhead
Base64 increases file size by roughly 33% because every 3 bytes of binary data are represented as 4 characters.
URL-Safe Base64
Standard Base64 uses + and /, which have special meanings in URLs. URL-Safe Base64 replaces them with - and _.
100% Client-Side
All encoding and decoding happen directly in your browser using JavaScript, ensuring your files and strings remain completely private.