URL Encoder / Decoder

Online URL Encoder & Decoder

Our free online URL Encoder & Decoder converts special characters to percent-encoded format and decodes them back. Essential for web developers working with query strings, API parameters, and internationalized URLs.

Features:

  • Full URL Encoding: Encode entire URLs including special characters.
  • Component Encoding: Use encodeURIComponent for query parameters.
  • Smart Decoding: Automatically decode percent-encoded strings.
  • Unicode Support: Properly handles international characters and emojis.
  • Secure & Private: All encoding/decoding happens locally in your browser.

1. What is URL Encoding?

URL encoding, also known as percent-encoding, converts characters into a format that can be transmitted over the Internet. URLs can only contain a limited set of ASCII characters. Characters outside this set must be encoded as %XX where XX is the hexadecimal value.

2. Characters That Must Be Encoded

Reserved Characters: ! # $ & ' ( ) * + , / : ; = ? @ [ ]
Unsafe Characters: Space, < > " { } | \ ^ ` ~
Non-ASCII: Any character outside the basic ASCII set (including Unicode)

3. encodeURI vs encodeURIComponent

encodeURI: Encodes a complete URI, preserving characters with special meaning (: / ? # etc.)
encodeURIComponent: Encodes a URI component (like a query parameter), encoding ALL special characters including : / ? #

4. Common Use Cases

Query Parameters: Encoding user input in URL parameters
API Requests: Ensuring special characters don't break API calls
Form Submissions: application/x-www-form-urlencoded data
Bookmarks: Encoding page state in shareable URLs

5. Common Encoding Examples

Space → %20 (or + in query strings)
& → %26
= → %3D
? → %3F
# → %23
/ → %2F


This URL encoding tool helps developers properly encode URLs and query parameters.

100% client-side processing ensures your URLs remain private and secure.

Related Tools

base64-encoder-decoder

html-encoder-decoder

hex-string-converter

Understanding URL Encoding

The URL Character Set:

URLs can only use the ASCII character set. The safe characters are: A-Z, a-z, 0-9, and - _ . ~ All other characters should be percent-encoded for reliable transmission.

How Percent-Encoding Works:

1. Convert the character to its UTF-8 byte sequence
2. Convert each byte to hexadecimal
3. Prefix each hex value with %
Example: € → UTF-8: E2 82 AC → %E2%82%AC

URL Structure and Encoding:

Scheme: http:// or https:// (not encoded)
Authority: user:pass@host:port (@ and : have special meaning)
Path: /path/to/resource (/ separates segments)
Query: ?key=value&key2=value2 (& and = have special meaning)
Fragment: #section (not sent to server)

Best Practices:

• Always encode user-provided data in URLs
• Use encodeURIComponent for query parameter values
• Use encodeURI only for complete URLs
• Decode URLs before displaying to users
• Be aware of double-encoding issues