Base64 encode
Turn text or a file into Base64 — the one-directional encode half of our Base64 tool, on its own page for the common case of only needing to produce Base64 output, whether that is a UTF-8-safe text string or an image turned into a ready-to-paste data URI.
- Nothing you type leaves this page
- Works offline once loaded
- Free forever, no signup
Preparing Base64 Encode for you…
Loading the tool into your browser. Nothing is uploaded — the work happens on your device.
This decoded to binary data, not readable text — the bytes above may show as garbled characters. Use a hex/base64 viewer if you need the raw bytes.
- File {{ sizeLabel(fileResult.size) }}
- Base64 {{ sizeLabel(fileResult.rawBase64.length) }}
- Type {{ fileResult.mime }}
How to use this tool
-
Choose Text or File
Text encodes as you type; File converts anything you drop into a Base64 data URI.
-
Toggle URL-safe if needed
Swaps + and / for - and _ and strips padding, for Base64 that has to sit inside a URL.
-
Copy the result
Raw Base64, the full data URI, or a ready-made <img> tag and CSS url() snippet for images.
Questions people ask
What is Base64 encoding used for?
Turning binary data into plain text so it can travel through systems built to only handle text safely — embedding a small image directly in CSS or HTML, email attachments, and the header and payload of a JWT are all Base64 underneath.
Why does encoding Hindi text or emoji break some other Base64 tools?
The browser's native btoa() function only understands one byte per character and throws on anything outside Latin-1. This tool converts text to UTF-8 bytes first, so Devanagari script and emoji encode correctly rather than erroring out.
How do I put a Base64-encoded image straight into HTML or CSS?
Drop the image on the File tab — you get the raw Base64, the full data:image/…;base64,… URI, and copy buttons for a ready-made <img src="…"> tag and a CSS background-image: url(…) line.
Does Base64 make a file bigger?
Yes, by roughly 33% — fine for a small icon embedded in CSS, wasteful for anything large, since three bytes of binary data always become four Base64 characters.
Is anything I paste here sent to a server?
No. The whole tool is JavaScript running in your browser, and this site has no endpoint that accepts text. That matters when what you are pasting is a real API payload, a customer record, or a password.
Related tools
- Base64 Decode Decode a Base64 string back to readable text or binary, entirely in your browser. Auto-fixes pad...
- Base64 Encode/Decode Encode text or files to Base64 and decode Base64 back to text, entirely in your browser. UTF-8 s...
- Hash Generator Generate SHA-1, SHA-256, SHA-384 and SHA-512 hashes of any text in your browser using the Web Cr...
Bookmark this page — the tool keeps working offline, and your settings stay in this browser. Built by Dynamb Technologies, who make software for a living.