URL Encode and Decode
Encode special characters for URLs or decode percent-encoded strings back to readable text.
URL Encode and Decode tool
Example
Input: a b&c=d/é
Result: a%20b%26c%3Dd%2F%C3%A9
Reserved characters are percent-encoded: space becomes %20, & becomes %26, = becomes %3D and / becomes %2F. The é is encoded as its two UTF-8 bytes, %C3%A9.
How Common Characters Are Encoded
| Character | Encoded |
|---|---|
| space | %20 |
| & | %26 |
| = | %3D |
| ? | %3F |
| # | %23 |
| / | %2F |
| : | %3A |
| + | %2B |
| @ | %40 |
| , | %2C |
| ! ~ * ' ( ) | unchanged |
| é | %C3%A9 |
| € | %E2%82%AC |
Output of encodeURIComponent, which this tool uses.
- To encode, type or paste plain text into the Decoded URL panel.
- To decode, paste a percent-encoded string into the Encoded URL panel instead.
- The other panel updates instantly, using encodeURIComponent rules for encoding.
- If the encoded text contains an invalid sequence such as a lone %, read the error message and fix the input.
- Click the copy button above either panel to copy the transformed text to your clipboard.
Percent Encoding for URLs Explained
URL encoding, also called percent encoding, replaces characters that are not safe in a URL with a % sign and two hex digits. A space becomes %20, & becomes %26 and é becomes %C3%A9. Type plain text in the left panel to encode it, or paste encoded text in the right panel to decode it. Some characters have a job inside a URL. The ? starts the query string, & separates parameters, = joins a key to its value and # starts the fragment. If a search term contains one of them, such as Tom & Jerry, it must be encoded or the server will split it in the wrong place. Characters outside basic ASCII are first turned into UTF-8 bytes, and each byte gets its own %XX code.
The encoder uses JavaScript's encodeURIComponent. It leaves letters, digits and - _ . ! ~ * ' ( ) alone and encodes everything else, including / ? : @ & = + and #. That is the right choice for one query value or one path segment. Do not run a whole URL through it, because the :// and every slash will be encoded too. To split a full URL into its parts, use the URL Parser.
The decoder turns every %XX sequence back into its character. A + sign stays a +, since only HTML form encoding uses + for a space. A stray % that is not followed by two hex digits, or bytes that do not form valid UTF-8, produce an error message rather than a wrong result.
Sources
Frequently Asked Questions
Related Tools
Base64 Encode and Decode
Encode text to Base64 and decode Base64 strings back to readable text, with full UTF-8 support.
Developer ToolsHTML Entity Encode and Decode
Convert special characters to HTML entities and decode HTML entities back to readable text.
Developer ToolsJSON Formatter and Validator
Format, validate, beautify, and minify JSON data with a collapsible tree view and line-and-column error detection.
Developer ToolsURL Parser
Break down URLs into protocol, host, port, path, query parameters, and hash components.
Developer Tools