URL Encoder / Decoder
This tool encodes and decodes URLs entirely in your browser. Paste a raw string and get a percent-encoded URL, or paste an encoded URL and get back the readable original. No data leaves your device. The tool handles query parameters, path segments, Unicode characters, and reserved characters per RFC 3986. It is free, requires no login, and works offline once the page loads.
Encoding rules differ by context. Use query mode for parameter values and full URL mode when the whole link must stay valid.
Result
(empty)
Common encodings
| Character | RFC 3986 | Form |
|---|---|---|
| (space) | %20 | + |
| & | %26 | %26 |
| = | %3D | %3D |
| ? | %3F | %3F |
| # | %23 | %23 |
| / | %2F | %2F |
| 你好 | %E4%BD%A0%E5%A5%BD | %E4%BD%A0%E5%A5%BD |
How this tool works
The URL encoder converts characters not permitted in URL components into their percent-encoded equivalents (%XX hex pairs), and decodes percent-encoded strings back to plain text. RFC 3986 defines different encoding rules per component: query parameter values replace spaces, &, =, and most special characters with hex pairs; path segments leave forward slashes unencoded but encode spaces and punctuation. The tool applies the correct mode based on which URL component you select: full URL, path segment, query value, or fragment. It also resolves the common ambiguity around the + sign: in HTML form encoding, + represents a space, but strict percent-encoding uses %20. The tool decodes both and lets you choose which representation to encode to. Key assumption: the tool is designed for encoding individual URL components, not full URLs. If you paste a complete URL including the protocol and domain, the colon and slashes will be encoded, breaking the URL structure. Encode path segments and query values separately. Edge case: double-encoding occurs when an already-encoded string is encoded a second time, turning %20 into %2520. The tool detects likely already-encoded input by scanning for existing percent sequences and warns before applying a second encoding pass.
Worked example
Query value "sale price" under RFC 3986 becomes sale%20price. The same value under form rules becomes sale+price. Decoding %E2%9C%93 returns the checkmark character (U+2713).
Related tools
Frequently asked questions
What is the difference between encodeURI and encodeURIComponent?
encodeURI() encodes a full URL but leaves characters like :, /, ?, #, and & untouched because they have structural meaning in a URL. encodeURIComponent() encodes everything except unreserved characters (letters, digits, -, _, ., ~). This tool uses encodeURIComponent() by default because it is the correct choice for encoding individual parameter values. If you need to encode a full URL while preserving its structure, use the \\\"Encode full URI\\\" mode.
Is my data sent to a server?
No. The encoding and decoding happen entirely in your browser using JavaScript's built-in URL encoding functions. You can verify this by opening your browser's DevTools Network tab: no outbound requests are made when you encode or decode. This matters when you are working with API keys, tokens, or internal URLs that should not be shared.
What is double encoding and how do I fix it?
Double encoding happens when an already-encoded string gets encoded again. For example, %20 (a space) becomes %2520 because the % sign itself gets encoded to %25. This usually happens when a framework or library auto-encodes a value that you already encoded manually. To fix it, paste the string into the decoder and decode it twice. If the second decode produces the same result as the first, the string was only single-encoded.
What characters are safe to leave unencoded in a URL?
Per RFC 3986, unreserved characters are: uppercase and lowercase letters (A-Z, a-z), digits (0-9), hyphen (-), period (.), underscore (_), and tilde (~). These never need encoding. Reserved characters like :, /, ?, #, [, ], @, !, $, &, ', (, ), *, +, ,, ;, and = have special meaning in URLs and must be encoded when used as data rather than delimiters.
Why does my URL break when I include a plus sign?
In the application/x-www-form-urlencoded format used by HTML forms, a + sign represents a space. So if your actual data contains a literal +, it must be encoded as %2B to avoid being interpreted as a space on the server side. This tool encodes + to %2B by default, which is the correct behavior for parameter values.
Does this tool support batch encoding of multiple values?
The current version handles one input string at a time. For batch encoding, paste each value on a separate line and the tool will encode each line individually, preserving the line breaks in the output. This is useful when you have a list of parameter values to encode for a bulk API call.