Every URL is a contract with strict rules about which characters may appear. Letters, digits, and a handful of punctuation marks travel safely; a space, an ampersand, a hash sign, or an accented letter will break the URL or silently change its meaning. Percent encoding solves this by replacing every unsafe character with a percent sign and its hexadecimal byte value. This tool applies those rules live: paste text, and the encoded form appears instantly in the output panel.
The tool follows the encodeURIComponent convention, the standard for encoding individual query-string values in JavaScript. Everything except letters, digits, and the characters hyphen, underscore, period, and tilde is escaped. That conservative rule is the safest default for building parameters: even characters that many servers would tolerate raw, such as a slash or a colon, get escaped, so the value cannot be mistaken for URL structure no matter where it lands.
All conversion runs locally in your browser. Whether you are encoding a customer email address, an internal campaign tag, or a redirect target, the text never leaves your device. The tool is free, requires no account, and works the same on phone and desktop.
Which Characters Get Encoded and Why
URLs reserve certain characters for structure. The ampersand separates parameters, the equals sign joins keys to values, the question mark starts the query string, the hash starts a fragment, and the slash divides path segments. When a character like these appears inside a value, it must be escaped or the URL parser will misread where one parameter ends and the next begins. A space is simply not allowed at all. Everything outside the safe set is encoded byte by byte, using UTF-8 for anything beyond basic ASCII.
| Input | Encoded | Reason |
|---|---|---|
| space | %20 | Spaces are illegal in URLs |
| & | %26 | Would otherwise split one parameter into two |
| = | %3D | Would otherwise look like a key-value separator |
| ? | %3F | Would otherwise start a new query string |
| # | %23 | Would otherwise act as a fragment anchor |
| / | %2F | Would otherwise act as a path separator |
| é | %C3%A9 | Two UTF-8 bytes for one accented character |
The multi-byte case is worth studying because it surprises people. The accented e is not one character with one escape; it is two bytes in UTF-8, C3 and AD, so the encoded form has two escape sequences. The same logic scales to emoji, where a single symbol can occupy four bytes and produce eight hex digits of escapes. When you decode later, the byte sequence reassembles into the original character, so nothing is lost; the encoded form is just longer.
Building Safe Query Parameters: The Main Use Case
The most common encoding task is turning user input into one parameter of a query string. Suppose a search box contains the text shoes & size 10. Dropped raw into a parameter, the ampersand splits the value: the server sees a search parameter containing shoes and a second, bogus parameter named space-size with the value 10. Encoded, the value becomes shoes%20%26%20size%2010, one intact parameter, and the server-side split on ampersand now happens exactly where you intended.
A four-step habit keeps parameter building safe. First, encode every dynamic value individually, before joining them into the full URL. Second, join with raw ampersands and equals signs, which act as structure because they were never encoded. Third, never encode the whole assembled URL, or the question marks and ampersands themselves will be escaped and the URL will break. Fourth, when unsure, decode the final URL with the paired tool and confirm the parameters land where you expect.
Concrete before-and-after: take the parameters name Ana García, comment great price & fast ship, and page 2. Encoded values are Ana%20Garc%C3%ADa, great%20price%20%26%20fast%20ship, and 2. The assembled query string is name=Ana%20Garc%C3%ADa&comment=great%20price%20%26%20fast%20ship&page=2. Every separator is real structure, every value is intact, and the accented name survives any transport, including email clients and log systems that mangle raw non-ASCII text.
How to Use the Encoder (Step by Step)
- Paste or type the value you need to embed in a URL. Encoding runs live with no button to press.
- Confirm the output: safe characters stay readable, everything risky becomes percent escapes.
- Copy the encoded value and insert it into your URL, link template, or tracking tag.
- Assemble the full URL with unencoded structural characters, then test it in a browser or with the decode tool to confirm each parameter parses correctly.
Component Encoding Versus Full-URL Encoding
There are two different jobs in URL encoding, and mixing them up is the most frequent mistake. Component encoding, which this tool performs, escapes every reserved character, making a value safe to drop into any slot of a URL. Full-URL encoding, by contrast, deliberately preserves the structural characters so the URL still parses; it is for taking an already-complete URL and using it as a value, such as a redirect target inside a return parameter.
When you need the full-URL behavior, paste the URL through this tool and then manually restore the five structural characters, or note that the result is a component encoding and re-assemble. The tell-tale symptom of the wrong direction is a link that leads to a page not found: the question mark and ampersands were escaped, so the receiving server saw one long parameter name instead of a query string. Getting the direction right once, and then encoding component by component forever after, eliminates that class of bug.
A second honest caveat concerns spaces. Some systems, particularly older form handlers, expect a space as a plus sign rather than %20. Both decode to the same value in form-encoded context, but %20 is the safer universal choice, and this tool always emits %20. If a legacy consumer rejects the encoded value, the fix belongs on the receiving side, since %20 is the standard-conforming form.
Tips and Best Practices
- Encode values, never whole URLs; encode each dynamic piece before assembling the query string.
- Include the worst case in tests: a value containing an ampersand, an apostrophe, a space, and an accented letter will exercise every escape path.
- Watch for double encoding when values pass through several systems; a %25 in the output is the fingerprint of one layer too many.
- Keep UTM campaign values short and ASCII-only before encoding, so analytics dashboards group them consistently instead of splitting on encoding variants.
- For tokens and signatures pasted into URLs, encode the whole value; base64 padding appears as equals signs, which need escaping like any other character.
- Round-trip check new integrations: encode, transmit, decode on the other side, and compare with the original input byte for byte.