Base64 encode & decode
Encode text to Base64, decode it back, or turn a file into a ready-to-paste data URI — all in one tab, without anything leaving your browser. The text encoder is UTF-8 safe, so Hindi text and emoji round-trip correctly, unlike a plain btoa() call.
- Nothing you type leaves this page
- Works offline once loaded
- Free forever, no signup
Preparing Base64 Encode/Decode 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 or decodes as you type; File converts anything you drop into a Base64 data URI.
-
Pick a direction
On the Text tab, switch between Encode and Decode, and turn on URL-safe if the result needs to sit inside a URL.
-
Copy the result
Grab the raw Base64, the full data URI, or a ready-made <img> tag and CSS url() snippet for an image file.
Questions people ask
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.
What is Base64 used for?
It turns binary data into plain text so it can travel through systems that only handle text safely — embedding small images in CSS or HTML, email attachments, and the header and payload of a JWT are all Base64 underneath.
Is Base64 encryption?
No. Base64 is encoding, not encryption — anyone can decode it with the same three lines of code this tool uses. Never rely on it to protect a secret.
Why does Hindi or emoji text break other Base64 tools?
The browser's built-in 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, CJK characters and emoji all encode and decode correctly.
How do I put a Base64 image straight into HTML or CSS?
Drop the image on the File tab — you get the raw Base64, the full data:image/… URI, and copy buttons for a ready-made <img src="…"> tag and a CSS background-image: url(…) line.
Why does decoding fail with "invalid character"?
Usually missing = padding, or URL-safe characters (- and _) mixed into a string copied from a non-URL-safe source. This tool auto-fixes both before decoding, so a genuine failure means the text is not valid Base64 at all.
Related tools
- JWT Decoder Decode a JWT header and payload instantly, with human-readable exp/iat/nbf dates and an expiry s...
- URL Encoder/Decoder Percent-encode or decode text and URLs in your browser, plus a query-string parameter table view...
- 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.