URL Encoder / Decoder
Free online URL encoder and decoder. Encode special characters for safe URL use or decode percent-encoded URLs instantly.
Output will appear here…What Is URL Encoding?
URL encoding (also called percent-encoding) is a process that converts special characters in a URL into a format that can be safely transmitted over the internet. Characters like spaces, ampersands (&), question marks (?), and non-ASCII characters are replaced with a percent sign (%) followed by two hexadecimal digits. For example, a space becomes %20 and & becomes %26. URL encoding ensures that data passed in URLs is interpreted correctly by web servers and browsers.
How to Use the URL Encoder / Decoder
- Select 'Encode URL' to convert a plain text string or URL into a percent-encoded format.
- Select 'Decode URL' to convert a percent-encoded URL back to readable text.
- Paste or type your input into the left text area.
- The output appears instantly in the right panel.
- Click 'Copy' to copy the result, or 'Swap & Reverse' to use the output as input.
Features
- Instant encoding and decoding using the native encodeURIComponent / decodeURIComponent functions.
- Handles all special characters including spaces, Unicode, and reserved characters.
- Clear error messages for invalid encoded input.
- Swap & Reverse button for quick round-trip testing.
- Runs entirely in your browser — no data is sent to a server.
- Free and unlimited.
When Do You Need URL Encoding?
- When building query parameters for API requests (e.g., search terms with spaces).
- When constructing redirect URLs that contain other URLs as parameters.
- When working with form data that includes special characters.
- When debugging encoded URLs from server logs or analytics tools.
- When creating links that include non-ASCII characters (accented letters, CJK characters).
What Characters Get Encoded?
The encodeURIComponent function used by this tool encodes all characters except: A–Z, a–z, 0–9, -, _, ., !, ~, *, ', (, and ). This includes spaces (encoded as %20), /, ?, #, &, =, and all Unicode characters outside the ASCII range. If you need to encode a complete URL while preserving its structure, you should encode each component (path segments, query values) individually.
Frequently Asked Questions
What is the difference between encodeURI and encodeURIComponent?
encodeURI is designed to encode a complete URL and preserves characters like /, ?, #, and &. encodeURIComponent is designed to encode individual URL components (like a query parameter value) and encodes those reserved characters too. This tool uses encodeURIComponent, which is the safer and more common choice for encoding values within a URL.
Why is a space encoded as %20 and not as +?
Both are valid representations of a space, but in different contexts. %20 is the standard percent-encoding used in URI paths and query values. The + sign is used for spaces in application/x-www-form-urlencoded format (HTML forms). Our tool uses the %20 standard (encodeURIComponent).
Can I URL-encode an entire URL with this tool?
Yes, but this will encode the entire URL including ://, /, ?, and & — turning it into a single encoded string. This is useful when you want to pass a full URL as a query parameter. If you want to keep the URL structure intact but encode just the values, encode each query parameter value separately.
Is URL decoding safe? Can decoding a URL expose security risks?
Decoding a URL is safe for display purposes. However, in web applications, you should always validate and sanitize decoded URL parameters before using them in queries, file paths, or HTML output to prevent injection attacks.