Free Base64 Encoder / Decoder
Encode plain text or files to Base64, or decode Base64 strings back to readable text. Supports drag-and-drop file upload. All processing is done locally in your browser.
What Is Base64 Encoding?
Base64 converts binary data into a text-safe string using only 64 printable ASCII characters. This makes it possible to embed images, fonts, or any file directly in HTML, CSS, or JSON — and to transmit binary data over protocols that only support text.
Inline Assets
Embed images and fonts directly in CSS or HTML as data URLs, eliminating extra HTTP requests and improving page load performance for small assets.
Authentication
HTTP Basic Auth encodes credentials as Base64. JWTs use Base64url for their header and payload sections. Understanding this is essential for API debugging.
Data Transport
Email attachments (MIME), binary JSON fields, and XML data blobs all rely on Base64 to safely carry binary content through text-only channels.
How to Use the Tool
Encode text or any file to Base64, or decode any Base64 string — in seconds.
Text or File
Type or paste text in the top box, or drag and drop any file onto the card — images, PDFs, fonts, anything.
Choose Direction
Click "Encode" to convert text/file to Base64, or "Decode" to turn a Base64 string back into readable text.
Get Data URL
For file uploads, we automatically generate a ready-to-use data URL and show a preview for image files.
Copy & Use
Copy the Base64 string or data URL to your clipboard and embed it directly in your code.
Who Uses This Tool
Developers, designers, and security engineers who work with binary data daily.
Web Developers
Inline small images, icons, or fonts as Base64 data URLs to reduce HTTP requests in critical-path CSS.
API Engineers
Decode JWT payloads, debug HTTP Basic Auth headers, or inspect Base64-encoded API responses.
Designers
Convert SVG icons or small PNGs to Base64 for embedding directly in email templates or inline styles.
Security Teams
Decode obfuscated Base64 payloads found in logs, phishing emails, or security incidents.
What People Are Saying
Feedback from developers and security engineers who use this tool regularly.
The file drag-and-drop with image preview is brilliant. I use it to inline SVG icons in email templates and the data URL is generated instantly.
The byte size display is really useful. I can see exactly how much weight I'm adding to a CSS file before committing to inlining a Base64 image.
I decode JWT payloads constantly during API debugging. The fact it's fully client-side means I'm not shipping tokens to third-party servers.
Frequently Asked Questions
What is Base64 encoding?
Base64 is an encoding scheme that converts binary data into a string of ASCII characters using a 64-character alphabet (A-Z, a-z, 0-9, +, /). It is commonly used to transmit binary data over text-based protocols like HTTP headers, email (MIME), and JSON.
When should I use Base64 encoding?
Use Base64 when you need to embed binary data — like images, fonts, or files — inside text formats such as HTML, CSS, JSON, or XML. It is also used in HTTP Basic Authentication (username:password), JWTs, and data URLs.
Does Base64 compress data?
No. Base64 increases the data size by approximately 33%. Every 3 bytes of input become 4 Base64 characters. It is an encoding scheme for safe transmission, not compression.
Is Base64 encoding secure?
Base64 is not encryption — it provides no confidentiality. Anyone can decode a Base64 string instantly. It is only used to safely transmit data over channels that expect text, not to protect sensitive information.
Is my data sent to a server when I use this tool?
No. All encoding and decoding — including file processing — happens entirely in your browser using the native FileReader API and JavaScript's btoa/atob functions. Nothing is sent to any server.
What file types can I encode?
Any file type: images (PNG, JPG, SVG, GIF, WebP), PDFs, fonts, audio, video, documents — any binary file. For images, this tool also shows a live preview and generates a ready-to-use data URL.
Rank Higher Without
The Manual Work
LazySEO automates keyword research, content creation, and publishing — so you dominate Google and AI search results without spending hours on SEO.
No credit card required