URL Encoder / Decoder
Encode special characters in URLs for safe transmission or decode percent-encoded URLs back to readable text. Essential for building query strings and fixing broken URLs.
How to Use This Calculator
- Paste a URL or any text into the input field.
- Click "Encode" to convert special characters to percent-encoded format (e.g., space becomes
%20). - Click "Decode" to reverse the process and restore the original text.
- Use this for constructing query parameters or fixing broken URLs.
Formula
Reserved characters (? & = + # / %) and unsafe characters (space, <, >, {, }, etc.) are encoded. Letters, digits, and - _ . ~ are left unchanged per RFC 3986.
Examples
“hello world” → hello%20world (space encoded as %20)
“price = $50” → price%20%3D%20%2450 (= becomes %3D, $ becomes %24)
search?q=cafe%20latte&lang=en — The space in “cafe latte” is encoded as %20 for safe URL transmission.
Frequently Asked Questions
What is URL encoding?
URL encoding (percent-encoding) converts characters into a format that can be transmitted safely over the internet. It replaces reserved or unsafe characters with their %XX equivalents.
When do I need to encode a URL?
When constructing query strings with special characters (spaces, &, =, non-ASCII characters, etc.) or when you need to safely include user input in a URL.
What is the difference between encoding a full URL and just the query string?
A full URL has structure (scheme://host/path?query). Typically you only encode the values in the query string, not the URL structure itself (e.g., don’t encode the ? or & delimiters).
Is URL encoding the same as Base64?
No. URL encoding uses %XX notation for individual characters. Base64 encodes entire blocks of data into ASCII letters. They serve different purposes and have different use cases.