🛠️DevTools

Base64 URL Encoding Example

URLs often need to be encoded to Base64 when passing them as parameters or embedding them in other URLs. This avoids issues with special characters.

Try:
36 characters
48 characters

Quick Example

helloaGVsbG8=

Common Use Cases

📷Embed images in CSS/HTML
📧Encode email attachments
🔗Send binary data via JSON APIs
📄Convert PDFs for storage

💡 Tip: Just type or paste text — output updates instantly! Base64 is commonly used for embedding images, sending data over HTTP, and more.

Code Examples

Here's how to achieve this in different programming languages:

1// Encode to Base64
2const input = "https://example.com/path?query=value";
3const encoded = btoa(input);
4console.log(encoded); // "aHR0cHM6Ly9leGFtcGxlLmNvbS9wYXRoP3F1ZXJ5PXZhbHVl"
5
6// Decode from Base64
7const decoded = atob("aHR0cHM6Ly9leGFtcGxlLmNvbS9wYXRoP3F1ZXJ5PXZhbHVl");
8console.log(decoded);

Frequently Asked Questions

What is the Base64 encoding of "https://example.com/path?query=value"?

The Base64 encoding of "https://example.com/path?query=value" is "aHR0cHM6Ly9leGFtcGxlLmNvbS9wYXRoP3F1ZXJ5PXZhbHVl". Base64 converts each character to binary, then encodes in groups of 6 bits using A-Z, a-z, 0-9, +, /.

How do I encode text to Base64?

Use btoa() in JavaScript, base64.b64encode() in Python, or 'echo -n text | base64' in Bash. Our online tool above also encodes instantly.

How do I decode Base64 back to text?

Use atob() in JavaScript, base64.b64decode() in Python, or 'echo text | base64 --decode' in Bash.

Is Base64 encoding the same as encryption?

No, Base64 is NOT encryption. It can be easily reversed by anyone. Never use it to protect sensitive data.

Why does Base64 sometimes end with = or ==?

The = signs are padding. Base64 encodes in groups of 3 bytes to 4 characters. If input isn't divisible by 3, padding is added.

More Base64 Examples

Related Base64 Tools

📚 Learn More