URL Encoder/Decoder
Encode text into a URL-safe format or decode URL-encoded text.
Assumptions used in this calculation
- Encoding function: Uses encodeURIComponent/decodeURIComponent, suited for encoding individual query values rather than a full URL.
About this calculator
Spaces, ampersands, question marks and other special characters break URLs when placed directly into a query string or path segment, since those characters have their own structural meaning in a URL — so text with such characters needs to be percent-encoded before it's safe to use. This tool converts text to and from that percent-encoded format using JavaScript's encodeURIComponent and decodeURIComponent functions, the standard approach for encoding a single value like a query parameter rather than a full URL. Encoding turns unsafe characters into a % followed by their hex byte value (a space becomes %20, an & becomes %26), while decoding reverses the process back to readable text. Rather than manually substituting each special character's escape code from memory or guessing why a URL with unencoded characters is failing, this gives an instant, correct conversion for building query strings, debugging a broken link, or reading a percent-encoded value back into plain text.
Worked example
'hello world' → 'hello%20world'
Result: URL-safe text
Was this helpful?

