URL Encoder & Decoder

Encode and decode URLs instantly with percent-encoding (encodeURIComponent). Also supports Base64 encode/decode. Free, fast, works entirely in your browser — no data uploaded.

Did we solve your problem today?

What is URL Encoding?

URL encoding — also called percent-encoding — converts characters that are not allowed in URLs into a safe format. Each unsafe character is replaced by a percent sign (%) followed by two hexadecimal digits representing the character’s byte value in UTF-8.

For example, a space becomes %20, an ampersand & becomes %26, and the euro sign becomes %E2%82%AC. This tool uses JavaScript’s encodeURIComponent and decodeURIComponent functions, which handle the full Unicode range correctly.

When Do You Need URL Encoding?

URLs can only contain a limited set of characters defined by RFC 3986. Any character outside that set must be percent-encoded before the URL is used. Common situations include:

Failing to encode special characters causes broken links, incorrect query parsing, and security vulnerabilities like open-redirect attacks.

encodeURI vs. encodeURIComponent

JavaScript provides several encoding functions with different behaviour:

FunctionLeaves untouchedBest for
encodeURI():/?#[]@!$&'()*+,;=Encoding a complete URL
encodeURIComponent()Letters, digits, -_.!~*'()Encoding individual parameter values
escape() (deprecated)Letters, digits, @*_+-./Nothing — avoid it

This tool uses encodeURIComponent because encoding individual values is by far the most common use case. If you need to encode a full URL without touching its structure, use encodeURI instead (not available in this tool).

Common URL Encoding Examples

Original textEncoded result
hello worldhello%20world
user@example.comuser%40example.com
price=€10price%3D%E2%82%AC10
a&b=c+da%26b%3Dc%2Bd
/path/to/page%2Fpath%2Fto%2Fpage
<script>alert(1)</script>%3Cscript%3Ealert(1)%3C%2Fscript%3E

How to Use the URL Encoder

  1. Paste your text or URL-encoded string into the input box.
  2. Click Encode URL to convert plain text to percent-encoding.
  3. Click Decode URL to convert a percent-encoded string back to plain text.
  4. Click Copy to copy the result to your clipboard.

The encoder also runs live as you type in encode mode, so you can see the result immediately.

What is Base64?

Base64 is an encoding scheme that represents binary or text data using 64 printable ASCII characters: uppercase letters A–Z, lowercase letters a–z, digits 0–9, +, and /. A padding character = is added when necessary.

Base64 is widely used to:

Important: Base64 is not encryption. It is a reversible encoding that anyone can decode instantly. Never use Base64 to hide sensitive data.

Base64 and Unicode

The browser’s native btoa() function only handles ASCII and Latin-1 characters. This tool handles the full Unicode range by converting text to UTF-8 bytes first before applying Base64 encoding, and reversing the process when decoding. Emoji, Chinese characters, Arabic script and other Unicode text are all supported.

Base64 vs. URL Encoding — Side by Side

URL EncodingBase64
Primary useURL parameters and pathsBinary data in text formats
Output readabilityPartially readableOpaque ASCII
Output sizeVaries (3× for non-ASCII)Always ~33% larger
ReversibleYesYes
SecurityNoneNone
Handles UnicodeYes (via UTF-8 bytes)Yes (with UTF-8 pre-processing)

Privacy and Security

All encoding and decoding happens entirely in your browser. This tool uses only built-in JavaScript functions:

Your data is never sent to any server, stored, logged, or shared. You can even use this tool offline once the page has loaded.

FAQ

What is URL encoding?

URL encoding (percent-encoding) converts characters not allowed in URLs into a safe format. Each character is replaced by a percent sign followed by two hexadecimal digits representing its UTF-8 byte value. For example, a space becomes %20 and an ampersand becomes %26.

What is the difference between encodeURI and encodeURIComponent?

encodeURI is designed to encode a complete URL and leaves characters like / ? # & = untouched. encodeURIComponent encodes almost all special characters and is the correct choice for encoding individual query parameter values — which is what this tool uses.

Is my data sent to a server?

No. All encoding and decoding runs locally in your browser using built-in JavaScript functions (encodeURIComponent, decodeURIComponent, btoa, atob). Your data never leaves your device and is not stored anywhere.

What is Base64 encoding?

Base64 represents binary or text data using 64 printable ASCII characters. It is commonly used to embed images in HTML data URIs, encode data in HTTP headers, and pass binary data in JSON payloads. Base64 is not encryption — it is easily reversible.