URLencode online

Encode or decode text with urlencode. No key needed, fully reversible, and nothing leaves your browser.

Runs in your browser
Character by character

Which characters get a %

Letters, digits and - . _ ~ stay as they are. Every other character is turned into its UTF-8 bytes, and each byte is written as % and two hex digits. That is why ü becomes %C3%BC: two bytes, two escapes.

aa61␣%2020bb62&%2626cc63=%3D3dü%C3%BCc3 bc

8 bytes in, 18 characters out: +125 %

Typing in the tool above fills this in. Nothing leaves your browser.

In short

What is URL encoding (percent-encoding)?

URL encoding, also called percent-encoding, replaces every character that is not allowed or has a special meaning in a URL with % and two hex digits: a space becomes %20, & becomes %26, ü becomes %C3%BC. Letters, digits and - . _ ~ stay as they are. This tool works like PHP's rawurlencode() and follows RFC 3986.

Not encryptionAnyone can decode it, no key needed. It changes the format, not who can read it. Encoding vs hashing vs encryption →
Where you meet it
  • Query parameters (?q=…)
  • Path segments with spaces
  • Redirect and callback URLs
  • OAuth and API signatures
  • Form data (with + for spaces)
Every flavor at once

URL encoding: PHP, JavaScript, forms and Python compared

The encoder above works like PHP’s rawurlencode() (RFC 3986, spaces become %20). Other functions encode a few characters differently, which breaks signatures and cache keys. Type here to see all of them, and paste encoded text to find double encoding and broken % sequences.

Try:
FunctionWhat’s different
PHP urlencode()Spaces become +, ~ is encoded as %7E. What HTML forms and most PHP code send.
PHP rawurlencode() · RFC 3986Spaces become %20, ~ stays. Same as this site’s URL encoder; right for path segments.
JavaScript encodeURIComponent()Leaves ! ' ( ) * ~ unencoded, spaces become %20.
JavaScript encodeURI()Keeps : / ? # & = so a whole URL stays a URL. Wrong for single values.
HTML form · URLSearchParamsapplication/x-www-form-urlencoded: spaces become +, * stays.
Python quote()urllib.parse.quote: / stays by default, spaces become %20.
Use it in code

The same result in your code

Every snippet encodes a b&c=ü to a%20b%26c%3D%C3%BC exactly like the tool, then decodes it back. They are run and compared with the tool before each release.

PHP
echo rawurlencode('a b&c=ü'), "\n";
echo rawurldecode('a%20b%26c%3D%C3%BC'), "\n";
Python
from urllib.parse import quote, unquote

print(quote("a b&c=ü", safe=""))
print(unquote("a%20b%26c%3D%C3%BC"))

safe="" also encodes /, like rawurlencode(). quote_plus() would write + for spaces.

JavaScript
const enc = encodeURIComponent("a b&c=ü")
  .replace(/[!'()*]/g, (ch) => "%" + ch.charCodeAt(0).toString(16).toUpperCase());
console.log(enc);
console.log(decodeURIComponent("a%20b%26c%3D%C3%BC"));

encodeURIComponent() alone leaves ! ' ( ) * unencoded. Works in browsers and Node.js.

Java
import java.nio.charset.StandardCharsets;
import java.net.URLDecoder;
import java.net.URLEncoder;

public class Enc {
  public static void main(String[] args) throws Exception {
    String enc = URLEncoder.encode("a b&c=ü", StandardCharsets.UTF_8)
        .replace("+", "%20").replace("*", "%2A").replace("%7E", "~");
    System.out.println(enc);
    System.out.println(URLDecoder.decode("a%20b%26c%3D%C3%BC", StandardCharsets.UTF_8));
  }
}

URLEncoder follows HTML forms (+ for spaces), so three replacements make it match RFC 3986.

Go
package main

import (
	"fmt"
	"net/url"
	"strings"
)

func main() {
	fmt.Println(strings.ReplaceAll(url.QueryEscape("a b&c=ü"), "+", "%20"))
	s, _ := url.PathUnescape("a%20b%26c%3D%C3%BC")
	fmt.Println(s)
}
Command line
printf '%s' 'a b&c=ü' | jq -sRr @uri

# jq 1.5+; jq's @uri encodes like rawurlencode()
Test values

URL encoding (percent-encoding) examples and test values

What the tool returns for these inputs (UTF-8). Use them to check your own code. ↵ marks a line break.

InputURL encoding (percent-encoding)
hello worldhello%20world
a+b=c&da%2Bb%3Dc%26d
GrüßeGr%C3%BC%C3%9Fe
~-._!*'()~-._%21%2A%27%28%29
https://example.com/?q=1https%3A%2F%2Fexample.com%2F%3Fq%3D1
🙂%F0%9F%99%82
Common mistakes

Why your URL encoding (percent-encoding) doesn't match

Space: %20 or +?

rawurlencode(), RFC 3986 and this tool write %20. urlencode(), HTML forms and Python's quote_plus() write +. Decoding + with rawurldecode() keeps the plus; the variants below show all forms.

%2520: encoded twice

%25 is the percent sign itself, so %2520 is an encoded %20. Something encoded a value that was already encoded. Decode once more and fix the place that encodes twice.

encodeURIComponent is slightly different

JavaScript's encodeURIComponent() leaves ! ' ( ) * unencoded, PHP's rawurlencode() doesn't. That breaks OAuth and AWS signatures; the JavaScript example above adds the missing five.

Encode values, not the whole URL

Encoding a full URL turns ://, /, ? and & into %3A%2F%2F and friends, and the link stops working. Encode each parameter value on its own (or use encodeURI() for a whole URL).

%FC instead of %C3%BC

%FC is ü in Latin-1. It is not valid UTF-8, so it decodes to � here. Old systems still send it; fix garbled text can repair the result.

The tool trims and uses CRLF

Like the form on the original site, the tool removes spaces and line breaks at the start and end, and sends line breaks as CRLF (\r\n). That is why a result can differ from your code by one line break.

FAQ

Questions about URL encoding (percent-encoding)

Why is a space sometimes %20 and sometimes +?

%20 is RFC 3986 percent-encoding, used in paths and by rawurlencode() and encodeURIComponent(). + comes from HTML forms (application/x-www-form-urlencoded) and is only a space in the query string.

What is the difference between urlencode and rawurlencode?

rawurlencode() follows RFC 3986: spaces become %20 and ~ stays. urlencode() follows HTML forms: spaces become + and ~ is encoded as %7E. This tool works like rawurlencode().

Which characters don't need encoding?

A–Z, a–z, 0–9 and the four characters - . _ ~. Everything else, including spaces, umlauts and the reserved characters : / ? # [ ] @ ! $ & ' ( ) * + , ; =, is encoded inside a value.

Why do I see %25 in my URL?

%25 is an encoded percent sign. %2520 means a %20 was encoded a second time. Decode once more, then find the place that encodes twice.

Good to know

Before you rely on it

Searches the list of pages on this site. What you type stays in your browser.