How to encode a URL
- Paste the part that needs encoding: a search term, a query value, a path segment, or a complete parameter list.
- Press Encode URL. The tool applies JavaScript’s
encodeURIComponentrule set, which is the same one used by most URL builders and HTTP clients. - Copy the result into your link, form action, redirect parameter or API request. The output is plain ASCII, so it survives copy-paste through chat, email and ticketing systems.
- Need the reverse? Use URL Decode to turn escapes such as
%20back into readable text.
What percent-encoding actually does
Percent-encoding (RFC 3986) escapes bytes, not characters: each byte outside the unreserved set becomes % plus 2 uppercase hex digits, so every escaped byte costs exactly 3 characters. The unreserved set has 66 characters — 26 uppercase + 26 lowercase + 10 digits + - . _ ~ — and 18 characters are reserved (7 generic delimiters plus 11 sub-delimiters), which is why a raw &, =, ? or # changes a URL’s structure.
Non-ASCII text is converted to UTF-8 first, then each byte is escaped. 你 is U+4F60 = E4 BD A0 (3 bytes), so it becomes %E4%BD%A0; 你好 becomes 18 characters. Hello, 世界! is 10 characters and becomes 30, and a b&c=中 grows from 7 to 21. UTF-8 uses 1 to 4 bytes per code point, which is why CJK text and emoji produce so many escapes.
Measured examples (9 November 2026)
This encoder produced five rows on 9 November 2026 using the same encodeURIComponent rules the tool applies, measured in characters: Hello, 世界! (10 into 30 out), 你好 (2 into 18), a b&c=中 (7 into 21), 100% (4 into 6) and hello+world today (17 into 21). The growth comes from UTF-8 byte widths: 10 characters can be 14 bytes once Chinese text is included, and every escaped byte costs 3 characters.
Reserved characters and their escapes
The characters below are the ones that most often break a URL when they are left raw inside a value. The table shows the escape this encoder produces for each of them.
| Character | Encoded | Why it matters in a URL |
|---|---|---|
| space | %20 | Not allowed literally in a URL |
| & | %26 | Separates query parameters |
| = | %3D | Separates a parameter name from its value |
| ? | %3F | Starts the query string |
| # | %23 | Starts the fragment, which is never sent to the server |
| / | %2F | Separates path segments |
| + | %2B | A literal plus; in form data a plus means a space |
| % | %25 | The escape character itself |
| : | %3A | Separates scheme, host and port |
| @ | %40 | Separates user info from a host |
| " | %22 | Unsafe in URLs and often stripped by tools |
| < > | %3C %3E | Unsafe in URLs and in HTML output |
One nuance is worth knowing. encodeURIComponent also leaves ! ' ( ) * unescaped. Those characters are allowed in URLs but can be special in other contexts, so if an API demands a fully conservative escape, replace them after encoding.
Spaces: %20 or +?
Both appear in the wild, and they cost different lengths. In a URL path or query string a space is written %20 — 3 characters for 1 byte. In application/x-www-form-urlencoded data, the body format used by classic HTML forms, a space is a single + (1 character), and a literal plus must be written %2B (3 characters).
This tool always emits %20, the RFC 3986 escape for a URL component. If an API expects a form-encoded body, encode with this tool and then replace %20 with +; do not do that for path segments or for query strings parsed as RFC 3986, or the plus arrives as a literal plus character. The other 2 settings that differ between libraries are the slash: encodeURIComponent escapes it as %2F, while Python’s default quote() keeps it raw.
Encode components, not the whole link
Because encodeURIComponent escapes all 18 reserved characters, pasting a complete https://… address encodes its own separators and produces a string that is no longer a working link. That is sometimes exactly right: when a URL is a value inside another URL, for example a redirect parameter, the inner address must be fully encoded.
When you need a link that works, encode only the values. Keep the scheme, host, the path separators and the parameter names intact, and run this tool on the search term or the value side of each =. A full URL that starts https:// and ends with a path is typically 30–60 characters; encoding only the query value keeps the other 2 structural parts readable.
URL encoding in code
Languages agree on the algorithm and disagree on the defaults. JavaScript's encodeURIComponent(value) escapes all 18 reserved characters and leaves 71 characters unescaped; encodeURI is the whole-URL variant and keeps the separators. Python 3's urllib.parse.quote(value, safe='') matches encodeURIComponent when the safe set is empty, while the default safe='/' keeps 1 character, the slash, unescaped. PHP's rawurlencode($value) uses %20 for a space (1 byte → 3 characters), whereas urlencode() uses + (1 character) and is meant for form bodies.
Java's URLEncoder.encode(value, StandardCharsets.UTF_8) also writes a space as +, so replace it with %20 for a path; PowerShell's [Uri]::EscapeDataString($value) writes %20, and EscapeUriString keeps separators for whole URLs. In a shell, jq -sRr @uri percent-encodes stdin and is handy in pipelines. The 1 setting all of them share: non-ASCII text is converted to UTF-8 bytes before escaping, so 你好 is always 6 bytes and 18 characters, never 2.
Frequently asked questions
Should I encode the whole URL or just the parameters?
Encode only the values. A URL's structure depends on : / ? # & and =, so escaping the whole address destroys the structure. Run this tool on each query value or path segment, or use encodeURI for a complete URL when you only want to escape spaces and non-ASCII text.
Does this tool encode Chinese characters correctly?
Yes. Text is first turned into UTF-8 bytes and then escaped byte by byte, so 你好 becomes %E4%BD%A0%E5%A5%BD. When the receiving server decodes those escapes as UTF-8, the original characters come back exactly. The same applies to Japanese, Korean, Arabic and emoji.
What is the difference between URL encoding and Base64?
URL encoding makes text safe inside a URL; Base64 makes binary data safe inside a text channel. They are not interchangeable, and a Base64 decoder will reject a percent-encoded string. Neither one is encryption, and neither should be used to hide sensitive data.
Why does my URL show %20 instead of a space?
Literal spaces are not allowed in a URL, so browsers and HTTP libraries encode them. %20 is the escape for one space in a path or query component. If a service shows + instead, it is using HTML form encoding, where + means a space and %2B means a literal plus.
Is percent-encoding case-sensitive?
The hexadecimal digits are not: %2f and %2F are the same byte. This encoder writes uppercase letters, which is the conventional form. What is case-sensitive is the decoded value itself, because uppercase and lowercase letters are different bytes and decode to different text.