πŸ”— URL Encoder & Decoder

Encode and decode URLs instantly

βœ“ Free Forever πŸ”’ 100% Private ⚑ Instant Results

Common URL Encodings

Space%20 or +
& (ampersand)%26
= (equals)%3D
? (question)%3F
/ (slash)%2F
# (hash)%23
% (percent)%25
+ (plus)%2B

Why use our URL Encoder?

⚑

Instant Conversion

Encode or decode URLs in real-time as you type.

πŸ”’

100% Private

All processing happens in your browser. Nothing is sent to servers.

🎯

Two Modes

Choose between encodeURI and encodeURIComponent for your needs.

πŸ“‹

One-Click Copy

Copy encoded or decoded results instantly to clipboard.

🌐

All Characters

Handles all special characters, Unicode, and emojis.

πŸ“±

Mobile Friendly

Works perfectly on phones and tablets.

Frequently Asked Questions

πŸ”— Understanding URL Encoding

What is URL encoding?

URL encoding (also called percent-encoding) is a method to convert special characters into a format that can be safely transmitted in URLs. Characters like spaces, ampersands, and non-ASCII characters are replaced with a percent sign (%) followed by their hexadecimal ASCII value. For example, a space becomes %20.

What does URL encoded mean?

URL encoded means that special characters in a string have been converted to percent-encoded format. For example, "hello world" URL encoded becomes "hello%20world". This ensures the data can be safely included in a URL without being misinterpreted as URL syntax (like & or =).

What is URL encoded format?

URL encoded format (application/x-www-form-urlencoded) represents data where special characters are replaced with %XX (where XX is the hex value). Spaces can be either %20 or +. This format is commonly used in form submissions and query strings.

What is URL encoded data?

URL encoded data is information that has been converted using percent-encoding so it can be safely transmitted in URLs. This includes form data sent via POST requests, query parameters, and any text containing special characters that need to be included in a URL.

What is URL encoding for space?

Spaces in URLs can be encoded two ways: %20 (percent-encoding) or + (form encoding). The %20 format is more universally accepted. Our tool uses %20 by default with encodeURIComponent, which is the recommended approach for modern applications.

βš™οΈ How It Works

How does URL encoding work?

URL encoding works by converting unsafe ASCII characters to a "%" followed by two hexadecimal digits. The character's ASCII/Unicode code point is converted to hex. For example, the space character (ASCII 32, hex 20) becomes %20. Non-ASCII characters (like Γ© or ζ—₯) are first converted to UTF-8 bytes, then each byte is percent-encoded.

How to URL encode a string?

To URL encode a string: 1) Paste your text in the input field above, 2) Select "encodeURIComponent" for query parameters or "encodeURI" for full URLs, 3) Click "Encode URL", 4) Copy the result. In code, use JavaScript's encodeURIComponent() or Python's urllib.parse.quote().

How to URL decode?

To URL decode: 1) Switch to "Decode" mode using the tab above, 2) Paste your encoded URL or text, 3) Click "Decode URL", 4) View and copy the decoded result. The tool automatically handles both %XX encoding and + for spaces.

What is the difference between encodeURI and encodeURIComponent?

encodeURI encodes a complete URI, preserving characters like :, /, ?, #, and & that have special meaning in URLs. encodeURIComponent encodes everything except letters, numbers, and - _ . ~ characters. Use encodeURIComponent for query parameter values, and encodeURI when encoding a complete URL.

πŸ’» Programming

How to URL encode in JavaScript?

In JavaScript, use encodeURIComponent(str) for encoding query parameters or encodeURI(str) for full URLs. To decode, use decodeURIComponent(str) or decodeURI(str). Example: encodeURIComponent("hello world") returns "hello%20world".

How to URL encode in Python?

In Python, use urllib.parse.quote(string) for encoding or urllib.parse.quote_plus(string) to also encode spaces as +. To decode: urllib.parse.unquote(string). For complete URLs: urllib.parse.urlencode(dict) encodes key-value pairs for query strings.

How to URL encode in Java?

In Java, use URLEncoder.encode(string, "UTF-8") for encoding and URLDecoder.decode(string, "UTF-8") for decoding. Note that URLEncoder encodes spaces as + rather than %20. For %20 encoding, use: URLEncoder.encode(string, "UTF-8").replace("+", "%20").

How to URL encode in Bash?

In Bash, you can use: python3 -c "import urllib.parse; print(urllib.parse.quote('your string'))" or with curl: curl -Gso /dev/null -w %{url_effective} --data-urlencode "param=value" "". For simple cases: echo "string" | jq -sRr @uri (requires jq).

πŸ”’ Security

Does URL encoding prevent XSS?

URL encoding alone does NOT prevent XSS (Cross-Site Scripting). While it can help in some contexts, proper XSS prevention requires context-aware output encoding (HTML encoding for HTML context, JavaScript encoding for JS context, etc.). Always use proper security libraries and Content Security Policy (CSP) headers.

Does URL encoding prevent SQL injection?

No, URL encoding does NOT prevent SQL injection. URL encoding is for URL transmission, not database security. To prevent SQL injection, always use parameterized queries (prepared statements), input validation, and proper database escaping. Never rely on encoding alone for security.

Is URL encoding case sensitive?

The hex digits in percent-encoding (%XX) are case-insensitive according to RFC 3986 - %2f and %2F both represent "/". However, it's recommended to use uppercase letters for consistency. The actual characters being encoded (letters in the URL) remain case-sensitive.

Why is URL encoding needed?

URL encoding is needed because URLs can only contain certain ASCII characters. Special characters like spaces, &, =, and non-ASCII characters (Γ©, δΈ­, πŸŽ‰) would break URL parsing or be misinterpreted. Encoding ensures data is transmitted accurately and URLs remain valid.

πŸ“ Common Use Cases

How to URL encode special characters?

Special characters are automatically encoded when you use our tool. Common encodings: & becomes %26, = becomes %3D, ? becomes %3F, # becomes %23, / becomes %2F. Just paste your text and click encode - all special characters will be properly converted.

How to encode URL parameters?

For URL parameters, use encodeURIComponent (the default in our tool). This encodes all special characters including & and = which have special meaning in query strings. Example: ?name=John%20Doe&city=New%20York - each value should be encoded separately.

How to encode password in URL?

If you must include credentials in a URL (not recommended for security), encode special characters in the password using encodeURIComponent. Format: https://user:pass%[email protected] (where @ in password becomes %40). Better practice: use authentication headers instead of URL credentials.

What is URL decoder?

A URL decoder converts percent-encoded characters back to their original form. It reverses the encoding process: %20 becomes a space, %26 becomes &, etc. Use our decoder to read URLs that contain encoded characters, debug API responses, or convert encoded text back to readable format.