🛠️ URL Encoder / Decoder
❓ Frequently Asked Questions — URL Encoder
What is URL encoding and why is it needed?
URL encoding (percent-encoding) converts characters that are not URL-safe into a %XX hex format. URLs can only safely contain letters, digits, and a few symbols. All other characters must be encoded.
For example: a space becomes %20, an ampersand becomes %26, and a hash becomes %23. This prevents browsers from misinterpreting characters as URL structure when passing data in query strings, API requests, and redirect URLs.
What is the difference between URL encode and URL decode?
URL Encode — converts a plain string to percent-encoded format:
hello world&lang=en → hello%20world%26lang%3Den
URL Decode — converts a percent-encoded string back to readable form:
hello%20world%26lang%3Den → hello world&lang=en
Use encoding when building URLs. Use decoding when reading query parameters from incoming requests.
Which characters need to be URL encoded?
Characters that must be percent-encoded:
- Space →
%20 - Ampersand
&→%26 - Plus
+→%2B - Equals
=→%3D - Question mark
?→%3F - Hash
#→%23 - Slash
/→%2F - All non-ASCII characters (accented letters, emoji, Chinese, Arabic)
Characters that are safe and do NOT need encoding: A-Z a-z 0-9 - _ . ~
How do I encode URL parameters for an API request?
Each API query parameter value must be URL-encoded before appending to the URL. For example:
Search query: hello world & more
Encoded: hello%20world%20%26%20more
Final URL: https://api.example.com/search?q=hello%20world%20%26%20more
In code: use encodeURIComponent() in JavaScript, urllib.parse.quote() in Python, or urlencode() in PHP. Use this tool for quick manual encoding of API endpoint parameters.
What is the difference between encodeURI and encodeURIComponent?
In JavaScript, there are two encoding functions:
encodeURI()— encodes a full URL but keeps URL structure characters (/,?,=,&,#) unencoded. Use for full URLs.encodeURIComponent()— encodes everything including/,?,=,&. Use for individual parameter values.
Vicspot's URL encoder uses encodeURIComponent() logic — ideal for encoding individual query parameter values and form data.
How do I encode a redirect URL that contains another URL?
When embedding a URL inside another URL as a parameter (e.g., redirect_uri, return_url), the inner URL must be fully percent-encoded:
- ❌ Invalid:
https://app.com/auth?redirect=https://site.com/page?id=5 - ✅ Correct:
https://app.com/auth?redirect=https%3A%2F%2Fsite.com%2Fpage%3Fid%3D5
Paste the inner URL (https://site.com/page?id=5) into the encoder above → click Encode URL → use the result as your redirect parameter value.
What is the difference between URL encoding and HTML encoding?
They are completely different and serve different purposes:
- URL encoding — uses
%XXhex codes for URL-safe strings.&→%26 - HTML encoding — uses
&name;entities for safe HTML markup.&→&
Use URL encoding for query strings and API parameters. Use HTML encoding for displaying content in HTML pages and preventing XSS. Vicspot provides separate free tools for both.