Encode and Decode URLs and URI Components
A powerful tool for encoding and decoding URLs and URI components using JavaScript's encodeURIComponent and decodeURIComponent functions. Safely encode special characters for web URLs and decode percent-encoded strings.
The URL Encoder/Decoder tool allows you to safely encode and decode URLs and URI components. URL encoding replaces unsafe ASCII characters with a "%" followed by two hexadecimal digits, making the string safe for transmission over the internet.
Tip: The tool uses JavaScript's native encodeURIComponent and decodeURIComponent functions, which are the standard methods for URL encoding in web development.
URL encoding is essential when you need to include special characters, spaces, or non-ASCII characters in URLs. The encoding process converts characters into a format that can be safely transmitted over the internet.
Hello World!Hello%20World%21Note: encodeURIComponent encodes more characters than encodeURI. Use encodeURIComponent when encoding individual query parameters, but use encodeURI for full URLs.
URL decoding is the reverse process - it converts percent-encoded strings back to their original characters. The tool automatically detects if the input contains URL-encoded sequences and decodes them appropriately.
https%3A%2F%2Fexample.com%2Fpath%3Fid%3D123https://example.com/path?id=123Note: If the input doesn't contain valid percent-encoded sequences (matching the pattern %[0-9A-Fa-f]2), the decoded output will be identical to the input.
The tool provides built-in examples to help you understand how URL encoding works. Click any example to load it into the input field and see the encoding/decoding results.
Encodes spaces and special characters:
"Hello World!" → "Hello%20World%21"Special characters in email addresses:
"user@example.com" → "user%40example.com"Encodes query parameters and paths:
"?" → "%3F", "&" → "%26"Encodes symbols and special characters:
"!@#$%^&*()" → encoded versionEncodes spaces and mathematical operators:
"+" → "%2B", "=" → "%3D"This reference table shows the most common URL encoding conversions. The tool displays this information at the bottom of the interface for quick reference while working.
| Character | Encoded |
|---|---|
| Space | %20 |
| ! | %21 |
| " | %22 |
| # | %23 |
| $ | %24 |
| % | %25 |
| & | %26 |
| ' | %27 |
| Character | Encoded |
|---|---|
| ( | %28 |
| ) | %29 |
| + | %2B |
| , | %2C |
| / | %2F |
| : | %3A |
| = | %3D |
| ? | %3F |
Remember: Only characters that are unsafe or have special meaning in URLs need to be encoded. Letters (a-z, A-Z), numbers (0-9), and some safe characters (~, _, -, .) can be used directly without encoding.
Encode query parameters, API keys, and authentication tokens for safe inclusion in API requests.
Build URLs with dynamic parameters containing spaces or special characters without breaking the URL structure.
Encode form data for submission via GET requests where parameters appear in the URL query string.
Decode percent-encoded URLs to inspect query parameters and debug routing issues in web applications.
Once you have encoded or decoded your content, several options are available for working with the output.
Copies the encoded or decoded output to your clipboard with one click.
Downloads the output as a .txt file with an appropriate filename.
Resets the input and all output fields to start fresh.