URL Encode

URL-encode text online. Percent-encode special characters for safe use in URLs, query strings, and form data.

💡 Enter text → get URL-encoded. Example: "hello world" → "hello%20world".

0

How to URL Encode Text

Step-by-step guide with examples

Input
Convert
Result
1

What is URL Encoding?

URL encoding (percent-encoding) replaces unsafe characters in URLs with a % followed by two hex digits. For example, a space becomes %20. This ensures URLs are valid and special characters are transmitted correctly.

2

How URL Encoding Works

1. Identify characters that are not URL-safe (spaces, &, =, ?, #, etc.). 2. Convert each unsafe character to its UTF-8 byte sequence. 3. Replace each byte with %XX where XX is the hex value. Example: "hello world" → "hello%20world" "name=John&age=30" → "name%3DJohn%26age%3D30"

3

When to Use URL Encoding

• Building query strings with user input. • Passing special characters in URL parameters. • Encoding form data (application/x-www-form-urlencoded). • Creating safe redirect URLs. • Encoding file paths with spaces or special characters.

Frequently Asked Questions

3 common questions answered

3 Questions3 AnswersClick to expand
Q1What is URL encoding?
URL encoding replaces unsafe characters in URLs with percent-encoded equivalents (%XX). It ensures URLs are valid by encoding spaces, ampersands, and other special characters.
Q2What characters need URL encoding?
Spaces, &, =, ?, #, %, +, @, and other non-alphanumeric characters need encoding. Alphanumeric characters and -_.~ are safe and don’t need encoding.
Q3What is the difference between URL encode and HTML encode?
URL encoding uses %XX for unsafe URL characters (e.g., space=%20). HTML encoding uses named/numeric entities for characters with special HTML meaning (e.g., < = &lt;).