π URL Encoder / Decoder
Encode and decode URL components, query strings, and form data instantly β free, clientβside, and privacyβfocused.
π What is URL Encoding?
URL encoding (percent encoding) converts unsafe characters into a format that can be safely transmitted over the internet. URLs can only contain ASCII characters from a limited set (A-Z, a-z, 0-9, and some special symbols like -_.~). All other characters must be encoded.
Encoded characters are represented as % followed by two hexadecimal digits. For example, a space becomes %20, and an ampersand (&) becomes %26.
βοΈ How to Use This Tool
- To encode: Enter plain text (e.g.,
hello world & co) and click Encode. You'll gethello%20world%20%26%20co. - To decode: Enter an encoded string (e.g.,
hello%20world) and click Decode. - Clear resets both fields.
- Swap copies the output back to the input for quick roundβtrip testing.
- Click Copy Result to copy the output to your clipboard.
π Common URL Encoding Table
| Character | Encoded Value | Description |
|---|---|---|
| %20 | Space | |
| ! | %21 | Exclamation mark |
| " | %22 | Double quote |
| # | %23 | Hash / fragment |
| $ | %24 | Dollar sign |
| % | %25 | Percent sign |
| & | %26 | Ampersand (query separator) |
| ' | %27 | Single quote |
| ( | %28 | Left parenthesis |
| ) | %29 | Right parenthesis |
| + | %2B | Plus sign |
| , | %2C | Comma |
| / | %2F | Forward slash |
| : | %3A | Colon |
| ; | %3B | Semicolon |
| = | %3D | Equals sign |
| ? | %3F | Question mark |
| @ | %40 | At symbol |
π§ When to Use encodeURI vs encodeURIComponent
This tool uses encodeURIComponent and decodeURIComponent, which are the standard JavaScript functions for encoding/decoding query parameters and form data.
encodeURIComponentencodes all characters exceptA-Z a-z 0-9 - _ . ! ~ * ' ( ). It is safe for encoding a value to be placed in a query string.decodeURIComponentreverses the process.
For whole URLs (not just components), use encodeURI which leaves characters like / ? # unencoded. But for most form/API data, encodeURIComponent is correct.
β Frequently Asked Questions
application/x-www-form-urlencoded (form data), spaces are encoded as +. But in standard URL encoding, spaces become %20. This tool follows the RFC 3986 standard, using %20 for spaces.%XX (invalid hex) will cause a URIError. You'll be prompted to correct your input.encodeURIComponent encodes non-ASCII characters as multiple percent-encoded bytes representing their UTF-8 sequence. For example, "ΓΌ" becomes %C3%BC. Decoding restores the original character.