URL Encoder & Decoder
Encode special characters for safe use in URLs or decode percent-encoded URL strings back to readable text.
Component mode encodes everything except letters, digits and - _ . ! ~ * ' ( ).
Related Tools
How to Use
- Enter a URL or Text — Paste a URL containing special characters to encode, or paste a percent-encoded string to decode.
- Select Encode or Decode — Choose Encode or Decode, then pick Component (for a single query value or path segment) or Full URL (keeps the URL structure such as :/?#&= intact). Tick "+ for spaces" for HTML form data.
- Copy the Result — The output updates as you type (or click the button). Review it, then use Copy to put it on your clipboard, or Swap to move the output back into the input.
About the URL Encoder & Decoder
The URL Encoder & Decoder converts text to percent-encoding and back. It gives you the two encoders built into every browser, encodeURIComponent for a single value and encodeURI for a whole address, plus form encoding, where spaces become +. Developers use it to build query strings and API calls by hand, marketers to check tagged campaign links, and anyone to read a long encoded link that someone pasted into a chat.
Three ways to encode
- Component (encodeURIComponent) encodes everything except A–Z, a–z, 0–9 and
- _ . ! ~ * ' ( ). Use it for one query value, one path segment or one form field, because it also encodes the characters that give a URL its structure, such as: / ? # & = +. Each non-ASCII character becomes its UTF-8 bytes, so é is%C3%A9. - Full URL (encodeURI) leaves the structure characters
; , / ? : @ & = + $ #alone and encodes spaces, non-ASCII letters, % itself and characters such as< > " { } | ^and square brackets. Use it to tidy a complete address that contains spaces or accents. - + for spaces switches Component mode to application/x-www-form-urlencoded, the format HTML forms and URLSearchParams use: spaces become +, and
! ' ( ) ~are encoded as well. When decoding, the same option turns + back into spaces.
Worked examples
| Input | Mode | Output |
|---|---|---|
rock & roll / 50% off? | Encode, Component | rock%20%26%20roll%20%2F%2050%25%20off%3F |
rock & roll / 50% off? | Encode, Component + for spaces | rock+%26+roll+%2F+50%25+off%3F |
https://example.com/a path/?q=café & co#top | Encode, Full URL | https://example.com/a%20path/?q=caf%C3%A9%20&%20co#top |
C++ tips | Encode, Component / Full URL | C%2B%2B%20tips / C++%20tips |
😀 | Encode, any mode | %F0%9F%98%80 |
a%2Fb%3Fc%26d | Decode, Component / Full URL | a/b?c&d / a%2Fb%3Fc%26d |
Edge cases
- Full URL mode does not protect values. In the third example the & inside "café & co" is left as it is, so a server would read it as the start of a new parameter. Encode each value with Component mode, then assemble the URL.
- The + sign is ambiguous: form data treats it as a space, while elsewhere it is a literal plus. A + left unencoded in a query value, like C++ in Full URL mode, may reach the server as "C" followed by two spaces.
- Decoding expects UTF-8. Legacy Latin-1 escapes such as
caf%E9, a % not followed by two hex digits (as in "100%"), and a cut-off sequence such as%C3are reported as invalid, with the problem sequence shown, rather than guessed. - Full URL decoding (decodeURI) keeps encoded structure characters such as %2F, %3F, %26, %3D and %23 encoded, so the address keeps its structure; Component decoding decodes everything.
- Each decode removes one layer. If
%25E9decodes to%E9, the text was encoded twice. - The input is never trimmed, so a trailing line break is encoded as
%0A.
When to use it
RFC 3986, the URI standard, allows the unreserved characters (letters, digits and - . _ ~) anywhere. The reserved characters : / ? # [ ] @ ! $ & ' ( ) * + , ; = act as delimiters, so they must be percent-encoded when they appear in data where they would otherwise be read as a delimiter. Typical jobs: putting a search phrase or a redirect address into a query parameter, building a mailto: link with a subject and body, fixing links that contain spaces or accents, and reading the parameters of a tracking link. The URL Encoding guide explains which characters need escaping and why. For readable page addresses, generate them with the URL Slug Generator so there is little left to encode.
Encoding and decoding use your browser's built-in functions, so links that carry tokens or personal details never leave your device.
Frequently Asked Questions
What is URL encoding (percent-encoding)?
URL encoding, formally called percent-encoding, replaces unsafe or reserved characters with a percent sign (%) followed by two hexadecimal digits representing the character's byte value. For example, a space becomes %20 and an ampersand becomes %26. This ensures the URL is parsed correctly by browsers and servers.
Which characters need to be encoded in a URL?
Reserved characters that have special meaning in URLs — such as ?, &, =, #, /, and @ — must be encoded when used as data rather than delimiters. Unsafe characters like spaces, angle brackets, curly braces, and pipe symbols should also be encoded. Unreserved characters (A-Z, a-z, 0-9, -, _, ., ~) are safe and do not require encoding.
What is the difference between encodeURI and encodeURIComponent?
In JavaScript, encodeURI encodes a full URI but preserves characters that are part of the URL structure (such as : / ? # & =). encodeURIComponent encodes everything except A-Z, a-z, 0-9 and - _ . ! ~ * ' ( ), making it appropriate for individual query parameter values. WritePadPro offers both: choose Full URL (encodeURI / decodeURI) or Component (encodeURIComponent / decodeURIComponent).
Why do spaces sometimes appear as + and sometimes as %20?
In the application/x-www-form-urlencoded format (used by HTML form submissions), spaces are encoded as +. In standard percent-encoding (RFC 3986), spaces are encoded as %20. Both are valid in their respective contexts. The tool supports both conventions: tick "+ for spaces" to encode spaces as + (form encoding, the same output as URLSearchParams) or to turn + back into spaces when decoding; leave it unticked to use %20.
Can I encode non-English characters in URLs?
Yes. Non-ASCII characters (accented letters, CJK characters, Cyrillic, etc.) are first converted to their UTF-8 byte sequences, and each byte is then percent-encoded. For example, the German umlaut ü becomes %C3%BC. Modern browsers display these as Internationalized Resource Identifiers (IRIs) but transmit them as encoded URIs.