Base64 Encoder
Encode text and files to Base64, with optional URL-safe encoding, instantly inside your browser.
What is Base64 encoding?
Base64 is a way of representing binary data — like an image, a file, or raw bytes — as plain text made up only of letters, numbers, and a few symbols. It's used whenever binary data needs to travel through a system built for text, such as embedding an image directly inside CSS or HTML, sending binary data in a JSON payload, or encoding credentials in an HTTP header.
This tool encodes both typed text and uploaded files, and decodes Base64 strings back into readable text, with an option for URL-safe encoding for contexts like query parameters where the standard Base64 alphabet's `+`, `/`, and `=` characters would need extra escaping.
GuideHow to use it
How encoding and decoding work
Encoding reads the input as raw bytes — either the UTF-8 bytes of typed text, or the exact bytes of an uploaded file — and maps every group of three bytes to four Base64 characters drawn from a 64-character alphabet. Decoding reverses that mapping to recover the original bytes, then interprets them as UTF-8 text. "URL-safe" encoding swaps the standard `+` and `/` characters for `-` and `_`, and omits trailing `=` padding, so the result can be used directly inside a URL without additional escaping.
Why it helpsFeatures & benefits
Why this runs entirely in your browser
Files and text encoded or decoded here can contain private data, so nothing is uploaded to a server. Every conversion runs in JavaScript locally in the tab, which means it keeps working offline once the page has loaded and nothing processed here persists after the tab is closed.
Common uses
Embedding a small image directly in CSS or HTML as a data URI, encoding binary data for a JSON API payload, decoding a Base64-encoded JWT segment or config value, or preparing a URL-safe token for a query parameter.
Frequently asked questions
A few things people usually want to know before trusting the numbers.
It replaces the standard + and / characters with - and _, and removes trailing = padding, so the result can be used directly in a URL without extra escaping.
Yes. Switch to File mode and upload or drag a file — its exact bytes are encoded to Base64, not just its text content.
Base64 text must only contain valid Base64 characters and correct padding. Extra characters, truncated input, or non-Base64 text will trigger this error.
No. Base64 is an encoding, not encryption — anyone can decode it back to the original data. It should never be used to protect sensitive information.
No. All encoding and decoding happens locally in your browser. Nothing typed, pasted, or uploaded here is sent to a server, stored, or shared.