URL Encoder/Decoder
Encode text to URL-safe format and decode percent-encoded strings back to readable text.
Paste a URL or text to encode, or a percent-encoded string to decode.
Your encoded or decoded result appears here.
Click any encoded value to copy it to your clipboard.
URL Encoder/Decoder β Encode and Decode URLs Online for Free
Our free online URL Encoder/Decoder lets you convert text to URL-safe percent-encoded format and decode percent-encoded strings back to readable text. Paste any URL or query parameter, encode or decode it instantly, and copy the result. Everything runs in your browser β no data is sent to any server.
What Is URL Encoding?
URL encoding (also called percent encoding) converts characters into a format that can be safely transmitted over the internet. URLs can only contain a limited set of ASCII characters β letters, digits, and a few special characters like hyphens and underscores. Any character outside this set must be encoded as % followed by its two-digit hexadecimal code.
For example, a space becomes %20, an ampersand becomes %26, and a forward slash becomes %2F. The encoding ensures that special characters like ?, &, and = are not misinterpreted as URL delimiters.
There are two types of URL encoding:
encodeURIComponentencodes all special characters including/,?,#,&, and=. Use this for encoding query parameter values or individual path segments.encodeURIpreserves URL structure characters like/,?,#, and&. Use this for encoding complete URLs that you want to remain functional.
Our tool lets you choose between both methods depending on your use case.
How to Use This Tool
- Paste your text or URL in the input area.
- Click "Encode" to convert special characters to percent-encoded format. The tool uses
encodeURIComponentby default, which is safe for query parameters. - Click "Decode" to convert percent-encoded strings back to readable text.
- Toggle encoding mode between "Component" (encodes everything) and "URI" (preserves URL structure) using the buttons below the input.
- Copy the result to your clipboard with one click.
All processing happens instantly in your browser.
Key Features
| Feature | Benefit |
|---|---|
| Bidirectional conversion | Encode text to percent-encoded format or decode it back |
| Two encoding modes | Component mode for query values, URI mode for full URLs |
| Real-time processing | Results appear instantly as you click encode or decode |
| Full Unicode support | Handles any character including emojis, CJK, and accented letters |
| Bulk processing | Encode or decode entire URLs and query strings at once |
| Zero data transfer | All processing happens locally in your browser |
Real-World Use Cases
Encoding Query Parameters
When building URLs with dynamic query parameters, values containing spaces, ampersands, or special characters must be encoded. For example, a search query like tool & die making must become tool%20%26%20die%20making to be safely included in a URL. Without encoding, the & would be interpreted as a parameter delimiter.
Decoding Encoded URLs
When receiving encoded URLs from APIs, logs, or redirects, you often need to decode them to understand the actual content. Percent-encoded strings like %2Fpath%2Fto%2Fpage are much easier to read when decoded to /path/to/page.
Preparing URLs for Social Sharing
Social media platforms and messaging apps sometimes break URLs that contain special characters. Encoding the URL ensures it arrives intact when shared in emails, chat messages, or social posts.
Debugging API Requests
When debugging REST APIs, you frequently encounter percent-encoded values in request URLs. Decoding them helps you verify that the correct parameters are being sent and received.
Common Encoded Characters
| Character | Encoded | Common Use |
|---|---|---|
| Space | %20 |
Word separator in URLs |
& |
%26 |
Ampersand in query values |
= |
%3D |
Equals sign in query values |
? |
%3F |
Question mark |
/ |
%2F |
Forward slash |
# |
%23 |
Hash / fragment identifier |
% |
%25 |
Percent sign itself |
+ |
%2B |
Plus sign |
@ |
%40 |
At sign (email in URLs) |
: |
%3A |
Colon |
; |
%3B |
Semicolon |
Γ© |
%C3%A9 |
Accented character (UTF-8) |
π |
%F0%9F%8E%89 |
Emoji (UTF-8) |
For HTML entity encoding, use our HTML Entity Encoder/Decoder. For Base64 encoding, try the Base64 Encoder/Decoder.
Tips for Working with URL Encoding
- Always encode query parameter values. Never put raw user input directly into a URL β always run it through
encodeURIComponentfirst. - Use the right encoding function.
encodeURIComponentfor individual values,encodeURIfor complete URLs. Using the wrong one will either break the URL structure or leave characters unencoded. - Double-encoding is a common bug. Encoding an already-encoded string turns
%20into%2520. Always decode first if you are unsure whether the string is already encoded. - Watch out for
+vs%20. In HTML form submissions, spaces are encoded as+instead of%20. Our tool uses the standard%20encoding, which is correct for URLs. - Test with real URLs. Paste actual URLs from your application to verify they encode and decode correctly. Pay special attention to query strings with multiple parameters.
Frequently Asked Questions
Is this tool free to use?
Yes. The URL Encoder/Decoder is completely free, requires no account, and has no usage limits.
Does the tool send my URLs to a server?
No. All encoding and decoding happens entirely in your browser using JavaScript's built-in encodeURIComponent, encodeURI, and decodeURIComponent functions. Your data is never transmitted over the network.
What is the difference between encodeURIComponent and encodeURI?
encodeURIComponent encodes all special characters including /, ?, #, &, and =. Use it for encoding individual query parameter values. encodeURI preserves these characters so the URL structure remains intact. Use it for encoding complete URLs.
Why does a space become %20 instead of +?
Both %20 and + represent a space, but they come from different encoding standards. %20 is the standard percent-encoding defined in RFC 3986 and used by encodeURIComponent. + is used in HTML form submissions (application/x-www-form-urlencoded). For URLs, %20 is the correct encoding.
Can I encode non-ASCII characters like emojis?
Yes. The tool uses UTF-8 encoding, so any Unicode character β including emojis, CJK characters, and accented letters β is properly encoded. For example, π becomes %F0%9F%8E%89.
What happens if I decode an invalid string?
If the input contains malformed percent-encoded sequences (like %ZZ), the decoder will attempt to process the valid portions and leave invalid sequences unchanged. The tool will show an error message if decoding fails completely.