🔒

URL Encode

✓ Free & no signup 🔒 Runs 100% in your browser Updated 2026-11-25 Website Management Tools

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.

InputEncodedReason
space%20Spaces are illegal in URLs
&%26Would otherwise split one parameter into two
=%3DWould otherwise look like a key-value separator
?%3FWould otherwise start a new query string
#%23Would otherwise act as a fragment anchor
/%2FWould otherwise act as a path separator
é%C3%A9Two 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)

  1. Paste or type the value you need to embed in a URL. Encoding runs live with no button to press.
  2. Confirm the output: safe characters stay readable, everything risky becomes percent escapes.
  3. Copy the encoded value and insert it into your URL, link template, or tracking tag.
  4. 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.

Frequently Asked Questions

What characters does URL encoding convert?
Everything except letters, digits, hyphen, underscore, period, and tilde, which is the encodeURIComponent convention. Reserved characters such as the ampersand, equals sign, question mark, hash, and slash are escaped because they have structural meaning in URLs, and a space becomes %20 because spaces are illegal in URLs. Characters outside basic ASCII are first converted to UTF-8 bytes, so an accented letter becomes two escape sequences and an emoji can become four. The tool applies these rules live as you type.
Why is a space encoded as %20 and not a plus sign?
Percent encoding defines %20 for a space, and that form is understood by every URL parser. The plus sign is an alternative shorthand used only in the application/x-www-form-urlencoded format that HTML forms use, and in path contexts a plus is a literal plus character instead. This tool always emits %20 because it is unambiguous everywhere. If a legacy system expects plus signs, the correct fix is on the receiving side, since %20 is the standard-conforming representation.
How do I encode a value so it is safe in a query string?
Encode the value by itself first, so every reserved character becomes a percent escape, then join it with other parameters using raw ampersands and equals signs as structure. Never encode the assembled URL, because that would escape the separators too and the parameters would merge into one broken string. As a check, decode the final URL afterward: each parameter should split exactly where you intended, and values should read as the original text you started with.
What is the difference between encodeURIComponent and encodeURI?
encodeURI is for a complete URL and deliberately preserves structural characters, including the question mark, hash, slash, and ampersand, so the URL still parses. encodeURIComponent is for a single value and escapes everything reserved, making it safe to drop into any slot. Using the full-URL function on a value lets ampersands and hashes leak through and corrupt the parameter list. This tool uses the component convention because parameter values are the most common encoding target.
Why does one accented character become two escape sequences?
Percent encoding works on bytes, not characters, and characters outside basic ASCII occupy multiple bytes in UTF-8. The accented e is bytes C3 and AD in hexadecimal, so it appears as %C3%A9. This is normal and lossless: when the value is decoded, the byte sequence reassembles into the original character. Longer scripts and emoji produce proportionally longer escapes, so a heavily non-ASCII string can grow several times in length after encoding, which is expected rather than a bug.
Can I encode a whole URL to use as a redirect parameter?
Yes, but understand which convention you need. This tool performs component encoding, which escapes the question marks and ampersands of the inner URL; that is exactly what you want when the URL is a value inside another URL, such as a return parameter. If the result needs to remain a working standalone URL instead, restore the five structural characters after encoding, or encode only the risky values inside it. Testing the link is the fastest way to confirm you picked the right direction.

Related Tools