URL Encoder & Decoder
Free URL encoder and URL decoder with live percent encoding. Parse URLs into components, build query strings, and reference encoded characters — all in your browser.
| Character | Encoded | Description | encodeURI | encodeURIComponent |
|---|---|---|---|---|
| (space) | %20 | Space character | %20 | %20 |
| ! | %21 | Exclamation mark | ! (kept) | %21 |
| # | %23 | Hash / fragment | # (kept) | %23 |
| $ | %24 | Dollar sign | $ (kept) | %24 |
| & | %26 | Ampersand / param separator | & (kept) | %26 |
| ' | %27 | Apostrophe | ' (kept) | %27 |
| ( | %28 | Open parenthesis | ( (kept) | %28 |
| ) | %29 | Close parenthesis | ) (kept) | %29 |
| + | %2B | Plus sign | + (kept) | %2B |
| , | %2C | Comma | , (kept) | %2C |
| / | %2F | Forward slash / path separator | / (kept) | %2F |
| : | %3A | Colon | : (kept) | %3A |
| ; | %3B | Semicolon | ; (kept) | %3B |
| = | %3D | Equals / key-value separator | = (kept) | %3D |
| ? | %3F | Question mark / query start | ? (kept) | %3F |
| @ | %40 | At sign | @ (kept) | %40 |
| [ | %5B | Open bracket | [ (kept) | %5B |
| ] | %5D | Close bracket | ] (kept) | %5D |
What is URL Encoding?
URL encoding, also known as percent encoding, is a mechanism defined in RFC 3986 for encoding information in a Uniform Resource Identifier (URI). It replaces unsafe or reserved characters with a percent sign (%) followed by their two-digit hexadecimal representation. For example, a space character becomes %20, an ampersand becomes %26, and a plus sign becomes %2B.
When to Use URL Encoding
- Query parameters: Encode values in URL query strings so that special characters like &, =, and spaces don't break the URL structure.
- Form submissions: HTML forms with
application/x-www-form-urlencodedcontent type automatically percent-encode field values before sending. - API requests: Safely include user-generated content, file names, or search queries in API endpoint URLs.
- Internationalized URLs: Encode non-ASCII characters (accented letters, CJK characters, emoji) so they can be used in URIs.
- Redirect URLs: When passing a URL as a query parameter (e.g., a return URL), it must be encoded to avoid ambiguity.
encodeURI vs encodeURIComponent
| Feature | encodeURI | encodeURIComponent |
|---|---|---|
| Purpose | Encode a complete URL | Encode a URL component (value) |
| Preserves | : / ? # [ ] @ ! $ & ' ( ) * + , ; = | Only A-Za-z0-9 - _ . ~ |
| Use case | Making a full URL safe | Encoding query param values |
| Space | %20 | %20 |
| & | & (preserved) | %26 |
| = | = (preserved) | %3D |
Frequently Asked Questions
What is URL encoding (percent encoding)?
URL encoding, also called percent encoding, replaces unsafe or reserved characters in a URL with a percent sign (%) followed by their two-digit hexadecimal value. For example, a space becomes %20 and an ampersand becomes %26. This is defined in RFC 3986 and ensures URLs are transmitted correctly across the internet.
What is the difference between encodeURI and encodeURIComponent?
encodeURI encodes a full URL but preserves characters that have special meaning in URLs like ://?#[]@!$&'()*+,;=. encodeURIComponent encodes everything except letters, digits, and - _ . ~ making it suitable for encoding individual query parameter values or path segments where reserved characters must be escaped.
How do I URL encode a string?
Paste or type your text into the input panel with Encode mode selected. Choose 'Full URL' mode to preserve URL structure characters, or 'Component' mode to encode everything (ideal for query parameter values). The encoded output appears instantly on the right.
How do I decode a URL-encoded string?
Switch to Decode mode using the toggle at the top, then paste your percent-encoded string into the input panel. The decoded plain text appears on the right in real time. This works for both encodeURI and encodeURIComponent encoded strings.
What characters need to be URL encoded?
Characters that must be percent-encoded include spaces, non-ASCII characters (like accented letters or emoji), and reserved characters when used outside their special meaning: : / ? # [ ] @ ! $ & ' ( ) * + , ; =. Unreserved characters (A-Z, a-z, 0-9, - _ . ~) are never encoded.
Is my data safe when using this URL encoder?
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.
How does the URL parser work?
Paste any URL into the URL parser section and it will break it down into its components: protocol (http/https), host, port, path, query parameters (displayed as a key-value table), and fragment. This uses the browser's built-in URL API for accurate parsing.
Related Tools
- Base64 Encoder Decoder — Encode and decode Base64 strings with file upload and URL-safe mode.
- JWT Decoder — Decode and inspect JSON Web Tokens with header and payload analysis.
- Regex Tester — Test and debug regular expressions online with real-time highlighting.