URL Encoder / Decoder
Encode or decode URLs and special characters instantly. Supports encodeURIComponent and encodeURI. Free, private, and runs in your browser.
Free Online URL Encoder & Decoder
URLs can only contain certain characters safely. Special characters like spaces, ampersands, question marks, and non-ASCII characters must be percent-encoded before being used in a URL. SmarterSources' URL Encoder/Decoder converts between plain text and URL-safe format instantly. Everything runs in your browser — nothing is sent to a server.
Encode Component vs Encode Full URL
Encode Component (encodeURIComponent) encodes all special characters, including those that have meaning in URLs like /, ?, &, and =. Use this when encoding a single query parameter value, a fragment, or any string that will become part of a larger URL.
Encode Full URL (encodeURI) preserves URL-structure characters like ://, /, ?, &, =, and #. It only encodes characters that are not valid anywhere in a URL, such as spaces and non-ASCII characters. Use this when you have a complete URL that just needs its special characters cleaned up.
How Percent Encoding Works
Percent encoding replaces each unsafe character with a % sign followed by two hexadecimal digits representing the character's byte value in UTF-8. For example, a space becomes %20, an ampersand becomes %26, and the Chinese character 你 becomes %E4%BD%A0. Decoding reverses this process, converting percent-encoded sequences back into their original characters.
Frequently Asked Questions
When should I use encodeURIComponent vs encodeURI?
Use encodeURIComponent when encoding a single value (like a search query or parameter value). Use encodeURI when encoding a full URL where you want to preserve the URL structure (protocol, slashes, query separators). In most cases, encodeURIComponent is what you want.
Why do I see %20 or + for spaces?
Both represent spaces in URLs. %20 is the standard percent-encoding for a space character. The + sign is an older convention used specifically in query strings (application/x-www-form-urlencoded). Modern web standards prefer %20, which is what encodeURIComponent produces.
What characters does encodeURIComponent encode?
encodeURIComponent encodes all characters except: A-Z, a-z, 0-9, hyphen (-), underscore (_), period (.), exclamation mark (!), tilde (~), asterisk (*), single quote ('), and parentheses (). Everything else, including /, ?, &, =, and #, gets percent-encoded.
Why does decoding sometimes fail?
Decoding fails when the input contains malformed percent-encoded sequences. For example, %ZZ is not a valid hex value, and a lone % without two hex digits is invalid. The error message will indicate the problematic sequence so you can fix it.
Is my data secure?
Yes. All encoding and decoding happens entirely in your browser using JavaScript. No data is sent to any server. Your URLs and text never leave your device.
Can I chain multiple encode/decode operations?
Yes. Use the "Swap" button to move the output back into the input field. This is useful when you need to double-encode (encode an already-encoded value) or when you want to decode a value step by step to see intermediate results.