URL Encode & Decode Online: What It Is and How to Use It

Tools 閲覧

What Is URL Encoding?

URLs can only contain a limited set of ASCII characters. When a URL includes spaces, non-ASCII characters (like Chinese or Arabic), or characters that have special meaning in URLs (like & or =), those characters must be converted to a safe format — this is URL encoding, also called percent-encoding.

For example: the space character becomes %20 because its ASCII hex value is 20. So hello world becomes hello%20world in a URL.

Why Does URL Encoding Exist?

  • Spaces aren't allowed in URLs
  • Special characters have reserved meanings&, =, ?, and # structure URLs, so they must be encoded when they appear as data
  • Non-ASCII characters must be converted to UTF-8 bytes first, then each byte percent-encoded

URL Encoder / Decoder Tool

Use the tool.tl URL Encoder or URL Decoder — paste any text to convert it instantly:

  1. Go to tool.tl/url-encoder (to encode) or tool.tl/url-decoder (to decode)
  2. Paste your text into the input box
  3. See the result update in real time
  4. Click "Copy" to use the output

Common URL Encoding Reference

CharacterURL EncodedNotes
Space%20 or ++ used in query strings only
!%21
#%23Normally marks a fragment/anchor
%%25The percent sign itself
&%26Separates query parameters
/%2FPath separator
=%3DKey=value separator
?%3FStarts query string
@%40

URL Encoding vs. Base64 Encoding

URL EncodingBase64 Encoding
PurposePass special characters safely in URLsEncode binary data as text
Output%XX formatA-Z, a-z, 0-9, +/=
ReadabilityPartially readableNot human-readable
Size increaseVariable (depends on chars)~33% larger
Typical useQuery parameters, form submissionsEmbedding images, API payloads

Common URL Encoding Pitfalls

Double Encoding

If you encode an already-encoded string, %20 becomes %2520 (because % itself gets encoded to %25). Always decode before re-encoding to avoid this.

+ vs %20 in Spaces

In query strings submitted via HTML forms (application/x-www-form-urlencoded), + means space. In the URL path, only %20 is correct for spaces — never use + there.

Encoding in JavaScript

Use encodeURIComponent() for individual parameter values (encodes everything except letters, digits, and - _ . ! ~ * ' ( )). Use encodeURI() for full URLs (preserves structural characters like :/?&=). Decode with decodeURIComponent() and decodeURI() respectively.

Frequently Asked Questions

What's the difference between %20 and + for spaces?

Both represent spaces, but in different contexts. %20 is valid anywhere in a URL. + only means space inside HTML form data (query strings). In URL paths, always use %20.

How do I URL-encode a string in Python?

Use urllib.parse.quote(string) for URL path encoding or urllib.parse.quote_plus(string) for form data (converts spaces to +). Decode with urllib.parse.unquote().

Why do some URLs show readable characters while others show %XX codes?

Modern browsers decode percent-encoded characters for display in the address bar — what you see is the human-readable version. The actual HTTP request still uses the encoded form. This is purely a display convenience.

Can I use the URL encoder for Base64 too?

They serve different purposes. For Base64, use the dedicated Base64 Encoder or Base64 Decoder tools instead.