URL Encoder
Percent-encode text for safe use in URLs, or decode it back, using the native encodeURIComponent/decodeURIComponent functions.
- 1Paste your text or URL component
- 2Select Encode or Decode
- 3Click Process
- 4Copy the result
What URL (percent) encoding is
URLs may only contain a limited set of characters. Anything else, including spaces, accented letters, emoji and symbols with a special meaning such as &, =, ?, # and /, must be written as a percent sign followed by the hexadecimal value of each UTF-8 byte. A space becomes %20, and é becomes %C3%A9. This tool encodes or decodes text with the browser's encodeURIComponent and decodeURIComponent functions, and you choose the direction.
Example
price=5 & tax=18% encodes to price%3D5%20%26%20tax%3D18%25. Decoding that string returns the original.
When to use it
- Building query-string values that contain spaces, ampersands or non-English text.
- Making a link to a search or redirect URL that itself contains a URL.
- Reading a long percent-encoded link from a log, analytics report or email.
- Debugging why a parameter is being cut off or mis-parsed on a server.
Encode the parts, not the whole URL
This function encodes reserved characters such as /, :, ? and &. That is exactly right for a value placed inside a query string, but if you paste an entire URL, its own slashes and colons will also be encoded and the link will no longer work. Encode each parameter value separately, then assemble the URL.
Details worth knowing
- Spaces use
%20, not+. The plus sign convention appears in HTML form submissions; browsers and servers usually accept both in query strings, but%20is correct everywhere in a URL path. - Double encoding happens if you encode already-encoded text:
%20becomes%2520. If you see that pattern, decode once. - Decoding errors. A lone
%that is not followed by two hex digits is invalid and cannot be decoded. - Not for security. Percent encoding does not protect or hide data.
Related tools: Base64 encoder, slug generator for clean URL slugs, and UTM builder for campaign links.