How to use the URL Encoder
1. Paste the text, URL component, or query string value you want to encode into the Input panel.
2. Click Encode URL — all non-safe characters are converted to percent-encoded sequences (e.g., space → %20, & → %26).
3. Copy the encoded output and embed it safely in a URL query string, redirect parameter, or API request.
4. If you need to decode a percent-encoded string back to plain text, use the URL Decoder tool.
What is it?
URL encoding (also called percent-encoding) converts characters that have special meaning in URLs — or are not allowed in URLs — into a safe representation. Each unsafe character is replaced by a % followed by two hexadecimal digits representing the character's UTF-8 byte value. For example, a space becomes %20, & becomes %26, and = becomes %3D.
This is necessary because URLs have a defined syntax where certain characters act as delimiters: ? starts the query string, & separates parameters, = separates keys from values, and # denotes a fragment. If your parameter values contain any of these characters as literal data, they must be percent-encoded to prevent the URL parser from misinterpreting them.
This tool uses encodeURIComponent(), which is the correct function for encoding individual query string values. It is more aggressive than encodeURI() (which preserves URL structural characters) and should be used when encoding parameters rather than full URLs.
Example
Hello World! Price: $49.99 & discount=10%
Hello%20World!%20Price%3A%20%2449.99%20%26%20discount%3D10%25
Special characters like spaces, &, =, and # are percent-encoded so they don't break URL structure.
Benefits
Encode query parameters so they survive HTTP transport
Spaces, ampersands, equals signs, and special characters must be percent-encoded to reach the server intact in query strings.
Decode percent-encoded URLs from server logs
%20, %2F, %3D — convert encoded log entries back to readable URLs to understand what users actually requested.
Build URLs programmatically without parameter injection
Encoding each component separately prevents query parameter injection and ensures the URL structure stays intact.
Debug broken URLs in APIs and redirects
Paste a broken URL and identify exactly which characters need encoding — the most common cause of redirect and API failures.
Frequently asked questions
What's the difference between encodeURI and encodeURIComponent?
encodeURI is for encoding a complete URL — it preserves structural characters like /, ?, &, =, and #. encodeURIComponent is for encoding individual values within a URL (like query parameter values) — it encodes those structural characters too, since they would otherwise break the URL structure. This tool uses encodeURIComponent.
When do I need to URL-encode?
Any time you're embedding user-provided or dynamic data into a URL query string. Common cases: search queries, redirect URLs, OAuth callback parameters, file paths with spaces or special characters, and form submissions built programmatically.
Why does a space sometimes become + and sometimes %20?
In HTML form submissions (application/x-www-form-urlencoded), spaces are encoded as +. In standard RFC 3986 URL encoding (used for most modern APIs), spaces are encoded as %20. This tool uses %20, which is the universally correct form outside of HTML form encoding.
Is my text sent to a server?
No. URL encoding is a simple mathematical transformation done entirely in your browser. Nothing is transmitted anywhere.