URL Encoder/Decoder
Percent-encode or decode URLs with a clear choice between full URL and component scope.
Written by Golam Rabbani, Founder & Lead Engineer
How to use this url encoder/decoder
- Set Mode to "Encode" to percent-encode text, or "Decode" to restore a percent-encoded string.
- When encoding, choose a Scope: "Component (encodeURIComponent)" for query-string values and path segments, or "Full URL (encodeURI)" for a complete, already-formed URL.
- Paste or type your text or URL into the "Text / URL to encode" (or "Percent-encoded string to decode") textarea.
- Press Encode (or Decode) to run the conversion and read the result in the output panel.
- Use Copy to put the result on your clipboard, or Reset to clear all fields and start over.
About this url encoder/decoder
The URL encoder and decoder converts text to and from the percent-encoding scheme defined by RFC 3986, letting you safely embed arbitrary characters inside a URL without breaking its structure.
Percent-encoding replaces each unsafe byte with a percent sign followed by two hexadecimal digits (e.g. a space becomes %20). The tool offers two encoding scopes. "Component (encodeURIComponent)" escapes everything except unreserved characters (A–Z, a–z, 0–9, - _ . ! ~ * ' ( )), making it the right choice for individual pieces such as a query-string value or a path segment, because it will also escape characters like =, &, ?, and / that carry structural meaning in a URL. "Full URL (encodeURI)" preserves those structural characters (: / ? # [ ] @ & = + , ;) so the URL remains navigable — use it only when the entire URL needs encoding, not for individual parameter values. Decoding always uses decodeURIComponent, which reverses all percent-encoded sequences; a malformed sequence (a bare % not followed by two hex digits) triggers an error message instead of producing garbled output.
Worked example: encoding the query value "Ada Lovelace & friends" with encodeURIComponent produces "Ada%20Lovelace%20%26%20friends" — spaces become %20 and the ampersand becomes %26 — so the server receives it as one value rather than splitting it into multiple parameters. All processing runs locally in your browser; no text is transmitted to a server.
FAQ
- What is a URL encoder and when do I need one?
- A URL encoder converts characters that are not allowed or have special meaning in a URL into percent-escape sequences (e.g. space → %20). You need one whenever you embed user-supplied text — names, search terms, addresses — into a URL as a query-string value or path segment.
- What is the difference between encodeURI and encodeURIComponent?
- encodeURI is designed for a complete URL — it leaves structural characters like /, ?, #, and & untouched so the URL stays valid. encodeURIComponent escapes those same characters, making it the correct choice for a single query-string value or path segment that must not interfere with URL structure.
- What does a percent escape actually mean?
- Each percent-encoded triplet — a % followed by two hexadecimal digits — represents one byte of the UTF-8 encoding of the original character. For example, the space character (UTF-8 byte 0x20) becomes %20, and the euro sign € (UTF-8 byte sequence 0xE2 0x82 0xAC) becomes %E2%82%AC.
- Should I use + for spaces instead of %20?
- + for spaces belongs to the application/x-www-form-urlencoded format used by HTML form submissions, not to RFC 3986 percent-encoding. This tool uses strict percent-encoding (%20 for spaces). If your target server specifically expects the form-urlencoded format, convert the %20 sequences to + after encoding.
- How can I avoid double-encoding a URL?
- Decode the string first, then re-encode it. Encoding an already-encoded string turns every % into %25, producing strings like %2520 instead of %20. Always start with the original unencoded text and encode once.
- Does this tool send my text to a server?
- No. The URL encoder runs entirely in your browser using the JavaScript built-ins encodeURIComponent, encodeURI, and decodeURIComponent. Nothing you paste is transmitted, logged, or stored.