Free Online URL Encoder / Decoder
Percent-encode special characters in URLs and query parameters, or decode percent-encoded strings back to readable text. Essential for building and debugging HTTP requests.
What is URL Encoding?
URL encoding (also called percent-encoding) converts characters that are not allowed in a URL into a %XX format where XX is the hexadecimal byte value. For example, a space becomes %20 and an ampersand becomes %26.
This tool uses the encodeURIComponent / decodeURIComponent functions, which encode every character except letters, digits, and - _ . ! ~ * ' ( ). This is the correct approach for encoding individual query parameter values.
How to Use the URL Encoder
- Select the mode — Encode to add percent-encoding, or Decode to remove it.
- Paste your text or URL into the left field.
- Click Encode URL / Decode URL to process. The result appears on the right.
- Use Swap to send the output back as new input and toggle the mode.
Common Use Cases
- Query string building: Safely encode user-supplied values before appending them to a URL as
?key=valueparameters. - API request construction: Encode path segments or query values that contain slashes, spaces, or special characters.
- URL troubleshooting: Decode an encoded URL from a log or browser address bar to see the original readable string.
- Form data encoding: Encode form field values for
application/x-www-form-urlencodedbodies.
Frequently Asked Questions
Whenever a value you're inserting into a URL — a query parameter, a path segment — might contain spaces, ampersands, slashes, or other characters that have special meaning in a URL. Encoding converts them to a safe %XX format so the URL parses correctly.
encodeURIComponent (what this tool uses) encodes every special character except letters, digits, and - _ . ! ~ * ' ( ) — the correct choice for encoding a single query parameter value, since it also encodes & and = which would otherwise break the query string. encodeURI leaves URL-structural characters like / and & alone, since it's meant for encoding a whole URL rather than one component of it.
Percent-encoding (RFC 3986) always represents a space as %20. The + shorthand for spaces is specific to the older application/x-www-form-urlencoded format used in HTML form submissions — both are valid depending on context, but %20 is the more universally correct choice.
Yes, switch to Decode mode and paste any percent-encoded string — it works regardless of what tool or system originally encoded it, as long as it follows standard percent-encoding.
It's completely free with no limits, and nothing is sent anywhere — encoding and decoding happen entirely in your browser using JavaScript.