URL Encoder / Decoder
Encode text for safe URL transmission or decode URL-encoded strings. Shows character mappings for special characters.
URL Encode
Results update instantly as you type
Enter Values
Embed Code
Copy and paste this HTML snippet into any web page to embed this calculator directly.
<iframe src="http://127.0.0.1:54963/embed/engineering/url-encoder-decoder?ref=embed" title="URL Encoder / Decoder" width="100%" style="max-width:600px; border:none; height:500px;" loading="lazy"></iframe>
Direct Link
Share this link to let others open the calculator in their browser.
The Formula
URL encoding (percent-encoding) converts characters into a format that can be safely transmitted in URLs by replacing unsafe characters with % followed by their two-digit hex code. Every character has an ASCII code, and percent-encoding simply writes that code in hexadecimal preceded by a percent sign. For example, the space character has ASCII code 32 decimal, which is 20 in hex, so it encodes as %20. This scheme ensures that URLs remain unambiguous and compatible across all web servers, proxies, and browsers, regardless of the underlying character encoding of the page.
Variable Definitions
Input Text
The text to URL-encode or the percent-encoded string to decode.
Encoded Output
Percent-encoded string safe for use in URLs.
How to Use This Calculator
- 1
Select Encode mode to convert special characters to percent-encoding for use in URL query parameters or path segments.
- 2
Select Decode mode to convert percent-encoded strings back to plain readable text, for example when debugging encoded URLs.
- 3
The encoding map shows which characters in your input were encoded and what their hex codes are.
- 4
Character counts show how encoding affects the length — strings with many special characters can grow significantly.
URL encoding replaces unsafe characters with % followed by their two-digit hex code for safe URL transmission.
Understanding the Concept
URL encoding (percent-encoding) replaces unsafe ASCII characters in URLs with a % followed by their two-digit hexadecimal code. For example, a space becomes %20, an ampersand (&) becomes %26, and a hash (#) becomes %23. Only alphanumeric characters (A-Z, a-z, 0-9) and the unreserved characters (- _ . ~) remain unencoded. Reserved characters like ?, /, :, @, &, =, +, $, and # must be encoded when they appear in data rather than as URL syntax delimiters. Without percent-encoding, special characters in query parameters would break URL parsing: if a search query contains "&", the server would misinterpret it as a parameter separator, so encoding it as %26 solves this problem. Modern browsers automatically encode certain characters in the address bar, but when constructing URLs programmatically in JavaScript, encodeURIComponent() encodes query parameter values safely while encodeURI() preserves structural characters like slashes.
Frequently Asked Questions
Sources & References
Related Calculators
Reviews
No reviews yet. Be the first to share your experience with URL Encoder / Decoder.
Write a Review
