URL Encoder & Decoder — Percent-Encoding Complete Guide

IP & Network views

What Is URL Encoding?

URL encoding (also called percent-encoding) converts characters that aren't allowed directly in URLs into a %XX format, where XX is the hexadecimal value of the character's UTF-8 byte(s). Examples:

  • Space → %20 (or + in form data)
  • &%26
  • =%3D
  • Chinese "你好" → %E4%BD%A0%E5%A5%BD

Why Is URL Encoding Necessary?

The URL standard (RFC 3986) only permits specific ASCII characters. When a URL needs to include special characters, they must be encoded first:

  • Reserved characters (: / ? # [ ] @ ! $ & ' ( ) * + , ; =) have special meaning in URLs — encode them when using them as data
  • Non-ASCII characters (Chinese, Japanese, symbols) are outside the allowed URL character set
  • Spaces cannot appear directly in URLs — must be %20 or +

encodeURI vs. encodeURIComponent (JavaScript)

FunctionDoes NOT encodeUse when
encodeURI()Letters, digits, - _ . ! ~ * ' ( ), URL structure chars (: / ? # @ & = + $ ,)Encoding a complete URL — preserves URL structure
encodeURIComponent()Letters, digits, - _ . ! ~ * ' ( ) onlyEncoding a single query parameter value
// Encode a full URL (preserves / ? = & structure)
encodeURI('https://example.com/search?q=hello world')
// → 'https://example.com/search?q=hello%20world'

// Encode a parameter value (& and = also get encoded)
encodeURIComponent('hello & world=1')
// → 'hello%20%26%20world%3D1'

How to Encode or Decode URLs Online

Use tool.tl's URL encoder or URL decoder:

  1. Go to tool.tl/url-encoder or tool.tl/url-decoder
  2. Paste your raw URL or encoded URL
  3. Get the encoded/decoded result instantly — click to copy

Common Use Cases

  • API development: Query string parameter values must be encodeURIComponent-encoded when constructing API requests
  • Debugging logs: Decode percent-encoded URLs in logs to read them
  • Form submissions: HTML GET forms auto-encode parameter values — decode them to read what was submitted
  • Sharing URLs: URLs copied from browser address bars may include encoded characters that you need to decode for readability

Frequently Asked Questions

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

%20 is the RFC 3986 standard encoding for space, valid anywhere in a URL. The + sign represents a space only in HTML form data (application/x-www-form-urlencoded) — specifically in query strings submitted via HTML forms. For API development, prefer %20 for consistency.

Do Chinese domain names need URL encoding?

No — internationalized domain names (IDN) use Punycode encoding, not percent-encoding. For example, 中文.com becomes xn--fiq228c.com. URL encoding applies to path and query string segments, not the domain name.

Is the tool free?

Yes — tool.tl's URL encoder and decoder are completely free, instant, and require no account.