URL Encoder / Decoder
Encode text to URL-safe percent-encoding or decode %XX sequences back to readable text. Essential for web developers working with query strings and APIs.
What is URL Encoding?
URL encoding (also called percent-encoding) converts characters that are not allowed in a URL into a format that can be transmitted safely over the internet. Each unsafe character is replaced by a % symbol followed by two hexadecimal digits representing the character’s ASCII code.
Characters That Get Encoded
- Spaces →
%20 - Special symbols:
&→%26,=→%3D,?→%3F,#→%23 - Non-ASCII characters: Chinese, Japanese, Arabic, emoji → multi-byte percent sequences
Safe Characters (Not Encoded)
Letters (A–Z, a–z), digits (0–9), and the symbols - _ . ! ~ * ' ( ) are considered safe and are not percent-encoded by encodeURIComponent.
Frequently Asked Questions
What is the difference between URL encoding and Base64?
URL encoding makes arbitrary text safe for use in URL query strings (e.g. hello world → hello%20world). Base64 encodes binary data into ASCII characters for transport in text-based systems. They serve different purposes and are not interchangeable.
Should I encode the entire URL or just the query string?
Only encode the values of query parameters, not the entire URL. Encoding the entire URL would also encode the ://, /, and ? characters, breaking the URL structure.
