How-to guide

How to Encode URL: Free Percent-Encoding Tool + Examples

Updated 2026-12-021588+ wordsFree tools · no signup

To encode a URL value, paste the single value — a search term, a name, a redirect target — into the URL Encoder and copy the percent-encoded result into your URL. URL encoding (percent-encoding, RFC 3986) replaces each illegal or structural character with % plus two hex digits per UTF-8 byte: space → %20, & → %26, = → %3D, é → %C3%A9. Encode each value on its own, never the whole URL, or you will escape the ?, & and / separators that make the address work.

How to encode a URL value (step by step)

  1. Open the URL Encoder.
  2. Decide what you are encoding: one value (a query parameter value or path segment) or a complete URL. These need different treatment — see the method section below. For a single value, you want component encoding, which escapes & ? = / # and friends.
  3. Paste or type the value into the Input to convert box. The RESULT box updates instantly as you type — no Convert button to press (verified live 2026-12-02). Load sample tries example text; Clear empties the box.
  4. Click Copy (or Download) above the RESULT box and paste the encoded result into your URL in place of the raw value, e.g. ?q= + encoded value.
  5. Sanity-check: a space should now read %20, an & inside your value should read %26, and letters, digits and - _ . ~ should be unchanged. If you see %2520, the value was encoded twice — start again from the raw value.

Worked example (verified with Python urllib.parse.quote(..., safe='')): café & bar → caf%C3%A9%20%26%20bar. Used correctly: /search?q=caf%C3%A9%20%26%20bar — one parameter, q. Encoded wrongly as a whole URL it becomes %2Fsearch%3Fq%3Dcaf%C3%A9%20%26%20bar, with no working query string left.

How percent-encoding works, in plain words

A URL is built from a small ASCII vocabulary. RFC 3986 splits characters into two groups:

  • Unreserved — never encode: A–Z a–z 0–9 - _ . ~. A correct encoder leaves these untouched everywhere.
  • Reserved — encode as data, keep as structure: : / ? # [ ] @ ! $ & ' ( ) * + , ; =. ? starts the query, & separates parameters, = joins name to value, # begins the fragment, / separates path segments. Inside a value, each must be escaped or the server reads it as structure.

The encoding itself works on bytes, not characters: take the character's UTF-8 bytes and write each byte as % plus two hex digits. ASCII characters are one byte (space 0x20 → %20); characters above ASCII take two to four bytes, which is why é (UTF-8 bytes 0xC3 0xA9) becomes %C3%A9 and ü becomes %C3%BC.

Verified character table (each row checked with Python quote(..., safe='') on 2026-12-02):

CharacterEncodedWhy it matters
space%20Illegal raw in a URL; %20 is correct anywhere
&%26Otherwise starts a new query parameter
=%3DOtherwise splits a parameter name from its value
?%3FOtherwise starts the query string
/%2FOtherwise splits a path segment in two
#%23Otherwise starts the fragment, which never reaches the server
+%2BReads as a space in form-encoded query strings
%%25Starts an escape sequence; a literal percent must itself be encoded
@%40Userinfo delimiter; encode inside values (e.g. email addresses)
é / ü%C3%A9 / %C3%BCNon-ASCII: one %XX group per UTF-8 byte

More verified examples: hello world & goodbye → hello%20world%20%26%20goodbye; price=10&discount=5 as one value → price%3D10%26discount%3D5; a b&c=d → a%20b%26c%3Dd; José García → Jos%C3%A9%20Garc%C3%ADa. A full URL carried as one parameter value — https://shop.example.com/search?q=café&page=2 — component-encodes to https%3A%2F%2Fshop.example.com%2Fsearch%3Fq%3Dcaf%C3%A9%26page%3D2: right for a redirect_uri parameter, wrong as a clickable link.

Component vs full-URL encoding: component encoding (encodeURIComponent) escapes everything structural — the safe default for any single value. Full-URL encoding (encodeURI) leaves : / ? # & = intact and only fixes never-legal characters like spaces; use it only to tidy a complete URL. Hellagape's tool shows no mode selector (verified live 2026-12-02); its test output — hello world & goodbye → hello%20world%20%26%20goodbye — is component-style. Treat it as a single-value encoder.

Tips and common mistakes

  • Encode values, not whole URLs. The classic break: encoding https://example.com/search?q=hello as one string gives https%3A%2F%2F..., which no longer works as a link. Encode each value, then join with real ?, & and =.
  • %20 vs + for spaces. %20 is RFC 3986 percent-encoding, correct anywhere in a URL. + meaning "space" is HTML form encoding and applies only in query strings/form bodies; in a path, + is a literal plus. Hellagape's tool uses %20 for spaces (verified live test, 2026-12-02). Reader test for the plus sign: encode a b+c — a%20b%2Bc means a literal plus is escaped too; if + survives unescaped, add %2B yourself for query values. Match the receiver's expectation.
  • Double-encoding. Encoding an already-encoded value turns %20 into %2520 (the % becomes %25). Any unintended %25 is the tell. Decode until the value stops changing, then encode once. The one legitimate case is a URL nested inside another, such as an OAuth redirect_uri.
  • A literal + must become %2B in query values, or it arrives as a space — C++ unencoded reads as C . Correct: ?q=C%2B%2B.
  • An unencoded # silently truncates. Everything after # is a fragment, never sent to the server, so the bug is invisible in server logs. Encode # in values as %23.
  • Slashes in path segments are legal but fragile. %2F means a literal slash, yet some servers/proxies reject or normalise it. If a value can contain slashes, put it in a query parameter instead.
  • Encoding is not security. Percent-encoding stops a value breaking out of its slot in the URL; it does not sanitise for HTML, SQL or a shell — the value is decoded again before use.
  • Privacy: URLs carry tokens and reset links as parameters. Prefer an encoder that runs in your browser; the Hellagape page states "Typing updates the result instantly. Nothing is sent anywhere." and carries a "Runs in your browser" badge (verified live 2026-12-02).
  • Undo: paste encoded text into the URL Decoder to get the original back; if it looks wrong, check for double-encoding (%25) first.

Related Hellagape tools: URL Decoder for the reverse trip, Base64 Encoder to carry bytes as text (encode its output before putting it in a URL), and Slug Generator for readable URL slugs.

FAQ

How do I encode a URL? Encode each value separately: paste the single value (search term, name, redirect target) into the URL Encoder, copy the percent-encoded result, and place it in the URL where the raw value would go. Example: café & bar → caf%C3%A9%20%26%20bar, giving /search?q=caf%C3%A9%20%26%20bar (verified).

What is percent-encoding? Percent-encoding (URL encoding) replaces each character that is illegal in a URL, or reserved for URL structure, with % plus two hex digits per UTF-8 byte: space → %20, & → %26, é → %C3%A9. It is defined by RFC 3986 and keeps data from being read as URL structure.

Which characters never need encoding? The RFC 3986 unreserved set: A–Z, a–z, 0–9, and - _ . ~. Everything else is either reserved (structural — encode it when it appears as data) or must always be encoded, including spaces, % itself, and all non-ASCII characters.

Should a space be %20 or +? Use %20 when building URLs yourself — it is correct in paths and query strings alike. + for space is HTML form encoding and means "space" only in query strings and form bodies; in a path it is a literal plus. Expect to receive + from forms, and encode a literal plus sign as %2B.

What is the difference between encoding a value and encoding a whole URL? Encoding a value (component encoding, e.g. encodeURIComponent) escapes structural characters like & ? = / so the value stays one piece of data. Encoding a whole URL (encodeURI) preserves those separators and only fixes illegal characters like spaces. Use value encoding for anything you insert into a URL; whole-URL encoding only to tidy a complete address.

Why does my URL contain %2520? Double-encoding: a space became %20, then the % was encoded again to %25, giving %2520, which decodes to the literal text %20 instead of a space. Decode repeatedly until the value stops changing to recover the original, then encode it once.

Do I need to encode non-English characters and emoji? Yes, for anything you construct programmatically. URLs are ASCII-only, so non-ASCII characters are encoded as their UTF-8 bytes: é → %C3%A9, ü → %C3%BC, José García → Jos%C3%A9%20Garc%C3%ADa (verified). Browsers show the readable form in the address bar but send the encoded form.

Is URL encoding a security measure? No. It stops a value splitting into extra parameters, but the value is decoded before use. It does not replace HTML escaping or parameterised queries.

How do I decode a URL-encoded string? Paste it into the URL Decoder: each %XX becomes its byte value and the bytes are read back as UTF-8, so caf%C3%A9%20%26%20bar returns café & bar. In query strings also treat + as a space; in paths, do not.

Try it now

URL Encoder

Percent-encode text and query values so they are safe inside URLs.

Open the free tool