01 Definition
URL encoding (also known as Percent-encoding) is a mechanism for encoding information in a Uniform Resource Identifier (URI) under certain circumstances. It ensures that characters which are not allowed in URLs are converted into a safe format.
URLs can only contain a limited set of characters (alphanumeric and -_.~).
02 How it Works
Unsafe characters are replaced with a % followed by two hexadecimal digits. These
digits represent the byte value of the character in the active character set (usually UTF-8).
03 Usage Scenarios
-
Query Parameters When search terms contain spaces or symbols:
q=hello worldbecomesq=hello%20world. -
Redirect URLs When passing a URL inside another URL parameter, ensuring characters like `?` or `&` don't break the parent URL.
-
Non-ASCII Filenames Encoding filenames with special or non-English characters for safe download links.
FAQ
Space: %20 or + ?
%20. However, in legacy form
submissions (application/x-www-form-urlencoded), spaces are often replaced with +.
This tool produces standard %20.
encodeURI vs encodeURIComponent?
encodeURI is for full URLs; it ignores special characters like : / ? # & =.
encodeURIComponent is for URL parameters; it encodes almost everything (including /
? &) to ensure data integrity.
This tool defaults to encodeURIComponent for maximum safety.
Does it support Unicode/Emoji?
Is there a URL length limit?
Is my data sent to a server?
More Free Tools
Base64 Encoder/Decoder
Free online Base64 tool. Convert text to Base64 and vice versa instantly.
JWT Decoder
Decodes JSON Web Tokens (JWT) instantly. View header and payload without sending data.
JSON Formatter
Pretty print, minify, and validate JSON data online with syntax highlighting.
Unix Timestamp
Convert between Unix Epoch Timestamp and human-readable dates. Supports seconds/ms.
Curl to Code
Convert curl commands to Python, JavaScript, Go, and more.
HTML ↔ Markdown
Bidirectional conversion between HTML and Markdown. Real-time preview and clean formatting.