URL Encoder & Decoder

Encode special characters in URLs and query parameters for safe web transmission
percent encoding for query strings, API calls and HTTP requests

๐ŸŒ URL Encoding for Web Development

URL encoding (also called percent encoding) converts special characters into a format that can be safely transmitted over the internet. Essential for query parameters, API endpoints, form data and any URL containing spaces or special characters. Our tool provides instant, accurate URL encoding and decoding.

โœ“ Encode query string parameters
โœ“ API endpoint construction
โœ“ Form data submission
โœ“ Safe URL generation
โœ“ Handle spaces and special chars
โœ“ Debug URL issues

๐Ÿ”’ URL Encoder

๐Ÿ”“ URL Decoder

๐Ÿงช Example URL Operations

Click an example to see URL encoding in action

Spaces
Hello World
%20 encoding
Query Parameter
Special chars
Special Characters
a & b = c
& = encoding
Unicode Text
Cafรฉ โ˜•
UTF-8 support

๐Ÿ“š Understanding URL Encoding

URL encoding (percent encoding) converts characters into a format that can be transmitted over the internet. URLs can only contain a limited set of characters - letters, numbers and a few special characters.

How URL Encoding Works:

  • Percent Sign - Encoded characters are represented as % followed by two hexadecimal digits
  • Safe Characters - A-Z, a-z, 0-9, - _ . ~ are never encoded
  • Reserved Characters - : / ? # [ ] @ ! $ & ' ( ) * + , ; = have special meaning in URLs and must be encoded when used as data
  • Space Encoding - Spaces can be encoded as %20 or + (in query strings)
  • UTF-8 Encoding - Unicode characters are first converted to UTF-8 bytes, then percent-encoded

Common Use Cases:

  • Query Parameters - ?search=hello%20world&filter=type%3Darticle
  • API Endpoints - https://api.example.com/users/john%40example.com
  • Form Submissions - application/x-www-form-urlencoded format
  • OAuth & Authentication - Encoding callback URLs and signatures
  • File Names in URLs - document%20name.pdf
  • Email Addresses - user%40example.com

Common Characters and Their Encoding:

  • Space - %20 (or + in query strings)
  • ! - %21
  • " - %22
  • # - %23
  • $ - %24
  • % - %25
  • & - %26
  • = - %3D
  • ? - %3F
  • @ - %40

Best Practices:

  • Always encode user input before adding to URLs
  • Use encodeURIComponent() for individual values, not full URLs
  • Don't double-encode already encoded URLs
  • Handle both %20 and + when decoding for compatibility
  • Validate decoded input for security (prevent injection attacks)
  • Use libraries in production code for proper encoding

โš ๏ธ Privacy Note: All encoding and decoding happens locally in your browser. No URLs or data are transmitted to servers.

โ“ Frequently Asked Questions

URL encoding (percent encoding) converts special characters into a format safe for URLs by replacing them with % followed by two hexadecimal digits. For example, space becomes %20, & becomes %26. It's required because URLs can only contain a limited set of characters (A-Z, a-z, 0-9 and a few special characters like - _ . ~).

Use URL encoding for: query string parameters (e.g., ?search=hello world), form data submission, API endpoint construction, passing data in URLs, handling special characters (&, =, ?, #, /, spaces), constructing OAuth signatures and ensuring URLs work across all browsers and servers.

encodeURI() encodes a complete URL, preserving special URL characters like :, /, ?, &. Use it for full URLs. encodeURIComponent() encodes individual URL components (query parameters, path segments), encoding ALL special characters including :, /, ?, &. Our tool uses encodeURIComponent for maximum safety with query parameters.

Both + and %20 represent spaces in URLs, but they're used in different contexts. In query strings (after ?), spaces are often encoded as +. In path segments (before ?), spaces are encoded as %20. Modern applications prefer %20 everywhere for consistency. Our tool uses %20 (percent encoding) as it's more universal.

Yes, but be careful! This tool encodes ALL characters, including URL structure characters like :, /, ?, &. It's best for encoding individual components (query parameter values, path segments). If you need to encode a complete URL while preserving its structure, only encode the specific parts that contain special characters.

Absolutely! All URL encoding and decoding happens locally in your browser using JavaScript. No data is ever transmitted to our servers or any third party. You can use this tool completely offline. Your URLs and query parameters never leave your device.