101webtools.com

Command Palette

Search for a command to run...

URL Encoder/Decoder

URLEncoderDecoder

Text to encode:

Loading...

Encoded result:

Loading...

Encoding Settings:

About URL Encoding/Decoding

How to use:

  1. Choose between Encode or Decode in the tabs
  2. Select the appropriate encoding/decoding function for your needs
  3. Enter your text in the input editor
  4. Click the Encode/Decode button to process your text
  5. Copy the results from the output editor
encodeURI vs encodeURIComponent
Understanding the differences

encodeURI

Designed for encoding complete URLs. It preserves characters that are part of URI structure:

: / ? # [ ] @ ! $ & ' ( ) * + , ; =

Example:

Original: https://example.com?q=hello world
Encoded: https://example.com?q=hello%20world

encodeURIComponent

Designed for encoding URL components (like query parameters). Encodes all special characters.

Example:

Original: hello world&category=tools
Encoded: hello%20world%26category%3Dtools

Common Use Cases
When to use which function

Use encodeURIComponent for:

  • Query string parameters
  • Path segments containing special characters
  • Any part of a URL that might contain reserved characters
  • Form data values

Use encodeURI for:

  • Complete URLs
  • When you want to preserve URL structure
  • When you need to maintain reserved characters

Tip: When in doubt, use encodeURIComponent for individual components and encodeURI for complete URLs.

Character Encoding Details:

URL encoding converts characters into a format that can be transmitted over the Internet. It replaces unsafe ASCII characters with a "%" followed by two hexadecimal digits. Both encodeURI and encodeURIComponent use UTF-8 encoding for non-ASCII characters, ensuring proper handling of international characters and symbols.

Space character

Encoded as %20 (not as +)

Non-ASCII characters

Encoded as UTF-8 byte sequences (multiple %XX values)

Reserved characters

E.g., & = ? have special meanings in URLs