URL & Base64 Encoder / Decoder

Instantly encode or decode URL-encoded strings and Base64 data. Everything runs in your browser — your data never leaves your device.

0 characters
Output will appear here…

What is URL encoding?

URL encoding is the process of converting characters in a URL into a format that can be safely transmitted across the internet. Also known as "percent encoding," it transforms unsafe or reserved characters — such as spaces, ampersands, and hash symbols — into their ASCII hexadecimal equivalents, prefixed with a % sign.

For example, a space becomes %20, a dollar sign becomes %24, and an ampersand becomes %26. This ensures URLs remain valid and unambiguous when passed between browsers, servers, and APIs.

What is URL decoding?

URL decoding is simply the reverse process. A percent-encoded string like Hello%20World%21 is decoded back to its readable form: Hello World!. Decoding is necessary whenever you receive a URL from a server response, a query parameter, or a log file and want to read its original content.

URL encoding example

Original textURL encoded
The cost of an apple is $2.The%20cost%20of%20an%20apple%20is%20%242.
user@example.comuser%40example.com
search query & filtersearch%20query%20%26%20filter

What is Base64 encoding?

Base64 encoding converts binary data into a plain-text representation using 64 printable ASCII characters: uppercase and lowercase letters (A–Z, a–z), digits (0–9), and the symbols + and /. An equals sign (=) is used as padding to ensure the output length is a multiple of 4.

It is commonly used to embed images or files directly in HTML, CSS, and JSON payloads — avoiding a separate HTTP request. It also appears in data URIs, HTTP Basic Authentication headers, email attachments (MIME), and JSON Web Tokens (JWTs).

How Base64 encoding works

Each group of 3 bytes (24 bits) of input data is split into four 6-bit groups. Each 6-bit group maps to one of the 64 Base64 characters. If the input length isn't a multiple of 3, padding (=) is added.

Step"ART" example
Input textART
ASCII values65, 82, 84
Binary01000001 01010010 01010100
6-bit groups010000 010101 001001 010100
Decimal16, 21, 9, 20
Base64 outputQVJU

What is Base64 decoding?

Base64 decoding reverses the process above — each Base64 character is mapped back to its 6-bit value, the groups are concatenated, and the original binary data is recovered. Padding characters (=) are discarded.

URL encoding vs Base64 encoding

Although both techniques transform data into safe text representations, they serve different purposes. URL encoding targets characters that are unsafe or reserved in the context of a URL — leaving most printable characters intact — while Base64 converts arbitrary binary data into a fixed set of 64 printable characters regardless of the original content.

Use URL encoding when constructing query strings, form data, or any part of a URI. Use Base64 when embedding binary content (such as images, PDFs, or cryptographic tokens) inside text-based formats like HTML, JSON, or email headers.

Frequently Asked Questions

Is my data sent to a server when I use this tool?

No. All encoding and decoding happens entirely in your browser using JavaScript's built-in encodeURIComponent, decodeURIComponent, btoa, and atob functions. Nothing is transmitted to any server.

Which characters does URL encoding leave unchanged?

encodeURIComponent does not encode the following characters: A–Z a–z 0–9 - _ . ! ~ * ' ( ). All other characters — including spaces, slashes, question marks, hashes, and equals signs — are percent-encoded.

Does Base64 encoding encrypt my data?

No. Base64 is purely an encoding scheme with no cryptographic properties. Anyone who receives a Base64 string can trivially decode it. If you need confidentiality, encrypt the data before encoding it.

Why does Base64 increase data size?

Because every 3 bytes of input become 4 Base64 characters, the encoded output is approximately 33 % larger than the original. Padding may add up to 2 extra = characters.

Can I encode binary files with this tool?

This tool works with text input. To Base64-encode a binary file (such as an image), you would first need to read the file as a byte array in a programming environment (e.g., using the FileReader API in JavaScript or base64 in Python) before encoding.

What is the difference between + and %20 for spaces?

Both represent a space, but they are used in different contexts. %20 is produced by encodeURIComponent and is valid in any part of a URL. The + sign is used specifically in application/x-www-form-urlencoded data (HTML form submissions) and is not universally understood in URL paths.

What does the = padding in Base64 mean?

Base64 output must be a multiple of 4 characters. If the final group of bits is fewer than 24 bits, one or two = characters are appended as padding. Some implementations omit padding (known as "unpadded Base64") and the decoder must handle both variants.

What is URL-safe Base64?

Standard Base64 uses + and / which have special meanings in URLs. URL-safe Base64 substitutes - for + and _ for /, making the output safe to include in query strings without further escaping. JWTs use URL-safe Base64 without padding.