Base64 & URL Encoder/Decoder

Base64 & URL Encoder/Decoder

Click or drag any image here to convert it to Base64

JPEG, PNG, WebP, GIF, SVG - any format your browser can display
Preview
Copied!

What Is Base64 Encoding?

Base64 is a way of representing binary or text data using only 64 printable ASCII characters (A-Z, a-z, 0-9, + and /). It doesn't compress or encrypt data - it just re-encodes it into a text-safe format that can travel safely through systems designed for text, like emails, JSON payloads, or URLs.

You'll commonly see Base64 used to embed small images directly in CSS or HTML as data URIs, to encode credentials in HTTP Authorization headers, and to store binary attachments inside text-based formats like JSON or XML.

What Is URL Encoding?

URL encoding (also called percent-encoding) converts characters that aren't allowed or safe in a URL - spaces, ampersands, slashes, non-ASCII letters, and more - into a %XX format, where XX is the character's hex byte value. This keeps query strings and path segments unambiguous.

For example, a space becomes %20 and an & becomes %26, so a value like tom & jerry can safely be passed as a single query parameter without breaking the URL's structure.

Common Use Cases

Inline Images (Data URIs)Embed small icons or images directly in CSS/HTML as Base64 data URIs, avoiding an extra network request.
Encoding Query ParametersURL-encode values before appending them to a query string so spaces and special characters don't break the link.
API Auth HeadersBasic Auth headers Base64-encode a "username:password" pair before sending it in the Authorization header.
Data URIs & PayloadsPass binary-ish data safely through JSON, XML, or form fields that only accept plain text.

Frequently Asked Questions

Is my data sent to a server when I encode or decode?

No. Everything runs entirely in your browser using JavaScript - nothing you type is ever uploaded or sent to a server.

Why does encoding Unicode text with plain btoa() fail?

The browser's built-in btoa() only supports Latin1 characters. This tool converts text to UTF-8 bytes first, so emoji, accented letters, and non-Latin scripts encode and decode correctly.

What's the difference between Base64 and URL encoding?

Base64 turns binary or text data into a compact set of 64 printable characters, commonly used for embedding data or transmitting it as text. URL (percent) encoding escapes characters that aren't safe in a URL, such as spaces and symbols in query parameters.

Can I convert an image to Base64, or a Base64 string back to an image?

Yes - switch to the Image tab. Drop or select any image your browser can display (JPEG, PNG, WebP, GIF, SVG, and more) to get its Base64 data URI, or paste a data URI or bare Base64 string to render and download it as an image file. Both directions run entirely in your browser using the File and Image APIs - the image is never uploaded.