URL Encoder / Decoder
Percent-encode URLs, query strings and path segments — or decode encoded strings back to plain text. Supports full URL encoding and component encoding, instantly in your browser.
⚡ Component mode — encodes everything including & = ? (use for query parameter values)
Output will appear here…
What is URL encoding?
URLs can only contain a limited set of ASCII characters. Characters outside that set — spaces, ampersands, equals signs, Unicode characters, emoji — must be percent-encoded (also called URL encoding). Each unsafe character is replaced by a % followed by its two-digit hexadecimal ASCII code. For example, a space becomes %20 and & becomes %26.
There are two flavours: encodeURI encodes a full URL, leaving structural characters (: / ? # & =) untouched since they have meaning in the URL structure. encodeURIComponent encodes everything including those structural characters — use this for individual query parameter values and path segments.
Decoding reverses the process: %20 → space, %2F → /, %C3%A9 → é. This tool handles both directions and both modes.
How to encode or decode a URL
- 1
Choose a mode
Select Encode to convert plain text to a percent-encoded URL, or Decode to convert an encoded URL back to readable text.
- 2
Choose encoding type
Full URL (encodeURI) preserves URL structure characters. Component (encodeURIComponent) encodes everything — use for query parameter values.
- 3
Paste and copy
Paste your input. The result appears instantly. Click Copy to grab the output or Swap to use the result as the new input.
Why URL encoding matters
Query string values
Values in query strings must be encoded: ?q=hello+world becomes ?q=hello%20world. Without encoding, ampersands and equals signs break the parameter parsing.
API request building
When constructing API URLs programmatically, encode each parameter value with encodeURIComponent before appending it to the URL.
International URLs
URLs containing non-ASCII characters (Arabic, Chinese, emoji) must be percent-encoded for HTTP transport. This tool handles full Unicode encoding.
Debug encoded URLs
When you see a messy encoded URL in logs or network requests, paste it here to read the human-friendly version instantly.
Encoding examples
hello world & morehello%20world%20%26%20moreencodeURIComponent encodes spaces as %20 and & as %26. Using + for spaces is a form-encoding convention (application/x-www-form-urlencoded), not standard URL encoding.
café ☕ résumécaf%C3%A9%20%E2%98%95%20r%C3%A9sum%C3%A9Non-ASCII characters are first encoded as UTF-8 bytes, then each byte is percent-encoded. %C3%A9 is the UTF-8 encoding of é.
encodeURI vs encodeURIComponent — which to use?
- encodeURI — use when encoding a complete URL. It does NOT encode:
A-Z a-z 0-9 ; , / ? : @ & = + $ - _ . ! ~ * ' ( ) #. These characters are structural parts of a URL and should be preserved. - encodeURIComponent — use when encoding a query parameter value, path segment, or any string that will be inserted into a URL. It encodes everything except:
A-Z a-z 0-9 - _ . ! ~ * ' ( ). This is the one you want for API calls. - Common mistake: using encodeURI on a query value that contains
&or=. Those characters won't be encoded and will break the query string parsing. Always use encodeURIComponent for parameter values.
Frequently asked questions
Both represent a space, but in different contexts. %20 is the standard percent-encoding for a space in any URL component. + represents a space only in application/x-www-form-urlencoded data (HTML form submissions). In query strings, + is widely accepted as a space by most servers, but %20 is more correct in non-form contexts.
encodeURIComponent encodes / as %2F. If the slash is meant to be a URL path separator, use encodeURI instead, or encode only the path segment values (not the slashes between them).
For a complete URL: encodeURI(url). For a query parameter value: encodeURIComponent(value). For decoding: decodeURI(url) or decodeURIComponent(component). Never use escape() or unescape() — they are deprecated and handle Unicode incorrectly.
The unreserved characters are safe in any URL part without encoding: A-Z, a-z, 0-9, hyphen (-), underscore (_), period (.), and tilde (~). Everything else should be percent-encoded when used as data.
Need another tool?
Browse the full toolbox or dig into the blog for the engineering behind it.