Percent-encoding is not optional — it is a strict requirement of the HTTP and URI specifications. Here are the five most common situations where it applies.
🔍Search Queries
Encode search terms before appending to a URL so spaces and symbols don't break the request. ?q=hello%20world is valid; ?q=hello world is not.
🔀Redirect URLs
When building redirect parameters like ?next=/dashboard?tab=settings, the inner URL must be component-encoded so the outer parser sees it as one value.
🌐API Requests
REST APIs require query parameters to be percent-encoded. Encoding email=user@example.com as email=user%40example.com ensures @ is not mistaken for a URL authority separator.
📋Form Data
HTML forms URL-encode data automatically on submission, but when constructing fetch() calls manually you must encode each value with encodeURIComponent.
🔧Config & Debugging
Decode logged or obfuscated URLs to read them clearly. Useful for debugging tracking URLs, affiliate links and redirect chains.
Common Encoding Examples
Real before-and-after examples you can load directly into the tool above.
Full URLhttps://example.com/search?q=hello world&lang=enhttps://example.com/search?q=hello%20world&lang=en
📖 How to Use the URL Encoder
1
Choose a Mode
Select Encode Component for query parameter values, Encode Full URL to encode a complete URL while preserving its structure, or Decode to reverse any encoding.
2
Paste Your Content
Type or paste your URL or text. Click Load Sample to see an example of what encoded/decoded content looks like.
3
Convert & Copy
Click Encode or Decode. The result appears with syntax highlighting. Use 'Use as input' for chained operations, or Copy to grab the result.
❓ Frequently Asked Questions
What is URL encoding?+
URL encoding (also called percent-encoding) converts characters that are not allowed in URLs into a format that can be safely transmitted. Special characters like spaces, &, =, and ? are replaced with a % followed by their hexadecimal code. For example, a space becomes %20 and & becomes %26.
When do I need to URL encode?+
You need URL encoding when passing data in query strings, building API requests, creating redirect URLs, encoding form data, or any time special characters appear in a URL. Without encoding, the URL may be misinterpreted by browsers and servers.
What is the difference between encodeURI and encodeURIComponent?+
encodeURI encodes a full URL and skips characters that are valid in URLs (like /, :, @). encodeURIComponent encodes a component (like a query parameter value) and encodes nearly everything including /, ?, =. Use encodeURIComponent for individual parameter values.
What characters are safe in URLs without encoding?+
The unreserved characters A-Z, a-z, 0-9, -, _, ., and ~ are always safe in URLs. All other characters should be percent-encoded for guaranteed compatibility across all systems.
Can I encode an entire URL at once?+
Yes — use Encode Full URL mode which preserves the URL structure (protocol, slashes, domain) while encoding only the parts that need it. Use Encode Component for individual query parameter values.