URL Encoder & Decoder - Encode URLs and Query Strings
Percent-encode text for URLs and query strings, or decode an encoded URL back to readable text — all in your browser.
Pick a mode, paste your text, and click Convert. Encode component is right for query-string values, Encode full URL keeps a whole address valid, and Decode reverses any percent-encoded string.
URL Encoder & Decoder - Encode URLs and Query Strings
Percent-encode text for URLs and query strings, or decode an encoded URL back to readable text — all in your browser.
Encodes every reserved character, including & = ? / and #. Use this for a single value inside a query string or path segment.
How it works: characters outside the unreserved set are replaced by their UTF-8 bytes written as %XX hex pairs — Encode component uses encodeURIComponent, Encode full URL uses encodeURI, and Decode uses decodeURIComponent.
About the URL encoder and decoder
URLs can only carry a limited set of characters safely. The specification behind every web address, RFC 3986, defines a small unreserved set — letters, digits, and the four symbols - _ . ~ — that may appear anywhere, and a reserved set like ? & = / and # that has structural meaning. Everything else, from a simple space to an accented letter or a CJK character, must be percent-encoded: the character is converted to its UTF-8 bytes and each byte is written as a percent sign followed by two hexadecimal digits. This URL encoder and decoder does that conversion for you in both directions, instantly and entirely inside your browser, so nothing you paste is ever sent to a server.
The tool offers three modes because JavaScript itself distinguishes two encoding jobs. Encode component wraps encodeURIComponent and escapes every reserved character. It is the right choice when you are building one piece of a URL — a search term, a redirect target, a token, or any value that goes after an equals sign in a query string. If that value contains & or =, leaving them raw would split your parameter in two; encoding them keeps the value intact.
Encode full URL wraps encodeURI and is meant for a complete address that is already structured. It escapes spaces, quotes, angle brackets, and non-ASCII characters, but deliberately leaves : / ? & = # alone so the scheme, host, path, and query keep their meaning. Running a whole URL through the component encoder instead would cripple it, turning the slashes and question mark into literal text.
Decode reverses the process with decodeURIComponent, converting %20 back to a space, %26 back to an ampersand, and multi-byte sequences such as %C3%BC back to the letter ü. Decoding is the quickest way to read a long tracking link, inspect an OAuth redirect, or debug what a form actually submitted. If the input contains a stray % that is not followed by two hex digits, the tool reports a clear error instead of returning garbage.
Typical uses include preparing query parameters for API calls, fixing links that break on spaces, embedding URLs inside other URLs, and untangling deeply nested redirect chains. One caution: percent-encoding is a transport syntax, not security. Encoded strings are trivially reversible, so never treat them as hidden, and always validate decoded input on the server.
URL encoding examples
How the three modes treat reserved characters, spaces, and non-ASCII text.
| Input | Output | Note |
|---|---|---|
| price=1+2 (Encode component) | price%3D1%2B2 | The = and + are reserved in query strings, so the component encoder escapes them to %3D and %2B. |
| https://example.com/my files/report 2024.pdf (Encode full URL) | https://example.com/my%20files/report%202024.pdf | Spaces become %20 while the scheme and slashes are left untouched. |
| na%C3%AFve (Decode) | naïve | The two-byte UTF-8 sequence %C3%AF decodes back to the single letter ï. |
| 50% off (Encode component) | 50%25%20off | A literal percent sign must itself be encoded as %25, otherwise decoders misread what follows it. |
How to encode or decode a URL
- Choose a mode: Encode component for a single value, Encode full URL for a complete address, or Decode to reverse encoding.
- Paste your text or URL into the Input box.
- Click Convert — the result appears immediately in the Output box.
- Copy the output where you need it, or click Clear to start over.
URL encoder & decoder FAQ
What is the difference between encodeURIComponent and encodeURI?
encodeURIComponent escapes every reserved character, including / ? & = and #, so it is used on individual values like query parameters. encodeURI leaves those structural characters alone and only escapes characters that are unsafe anywhere, so it is used on a full URL. The tool exposes both as Encode component and Encode full URL.
Why does a space become %20 and not +?
%20 is the standard percent-encoding for a space in URLs. The + convention comes from the older application/x-www-form-urlencoded format used by HTML forms, where it only applies inside the query string. This tool always emits %20; when decoding, a + is left as a literal plus, so replace + with %20 first if you are decoding form data.
Why do I get an error when decoding?
decodeURIComponent throws when it meets a % that is not followed by two valid hexadecimal digits — for example a literal percent sign in text like a discount figure, or a string that was cut off mid-sequence. Check that the input is genuinely percent-encoded and complete before decoding.
How are non-ASCII characters like accents, CJK, or emoji encoded?
The character is first converted to its UTF-8 byte sequence, then each byte is written as %XX. An accented letter usually becomes two escape pairs and an emoji becomes four. Decoding reassembles the bytes and interprets them as UTF-8, restoring the original character exactly.
Should I encode an entire URL with Encode component?
No. The component encoder escapes the colon, slashes, and question mark that give a URL its structure, which breaks the address. Encode a full URL with Encode full URL, and use Encode component only on the individual values you insert into it.
Is anything I paste sent to a server?
No. The conversion runs entirely in your browser using JavaScript's built-in encodeURIComponent, encodeURI, and decodeURIComponent functions, so URLs containing tokens, session ids, or private paths never leave your device.