URL Encoder & Decoder
Encode any string to RFC 3986 percent-encoded format or decode percent-encoded URLs back to readable text.
- Free
- No account
- Runs in your browser
- Nothing uploaded
Runs entirely in your browser — your input is never uploaded, logged, or stored.Privacy policy
What is URL Encoder & Decoder?
URL encoding (percent-encoding) represents characters as % followed by two hexadecimal digits. It's how special characters, spaces, and non-ASCII text are safely transported in URLs, query parameters, form data, and API requests.
RFC 3986 defines three character classes: • Unreserved characters (A-Z, a-z, 0-9, -, ., _, ~) are always safe and never encoded. • Reserved characters (!, #, $, &, ', (, ), *, +, ,, /, :, ;, =, ?, @, [, ]) have structural meaning in URIs. Encode them when they appear as data, not as delimiters. • All other characters (spaces, non-ASCII, control characters) must be percent-encoded.
Non-ASCII characters like emojis and accented letters are first converted to UTF-8 bytes, then each byte is percent-encoded separately. For example, the emoji 🎉 is 4 UTF-8 bytes (F0 9F 8E 89), becoming %F0%9F%8E%89.
The percent character itself is always encoded as %25 to avoid confusion with the escape marker.
Encoding per RFC 3986 §2.1:
1. Read input as UTF-8 bytes. 2. For each character: • If unreserved (A-Z, a-z, 0-9, -, ., _, ~): output as-is. • Otherwise: convert to UTF-8 bytes, then percent-encode each byte as %XX (uppercase hex).
Decoding reverses this: 1. Scan for %XX sequences. 2. Convert each %XX to its byte value. 3. Leave unencoded characters as-is. 4. Decode the resulting byte sequence as UTF-8.
Note: This tool encodes all reserved characters (RFC 3986 §2.2). Some tools leave certain reserved characters like ! or * unencoded. If you need a specific encode set (e.g., for query strings only), the output here is the most conservative option — safe in any URI position.
Worked examples
- Encode "Hello, World!": Hello%2C%20World%21
- Encode "https://example.com/path?q=hello&lang=en": https%3A%2F%2Fexample.com%2Fpath%3Fq%3Dhello%26lang%3Den
- Encode "🎉": %F0%9F%8E%89
- Encode "100%": 100%25
- Encode "café": caf%C3%A9
- Decode "Hello%2C%20World%21": Hello, World!
- Decode "%F0%9F%8E%89": 🎉
How to use URL Encoder & Decoder
- Paste your text or URL in the input box.
- Choose Encode (text → percent-encoded) or Decode (percent-encoded → text).
- Copy the result. Nothing is stored or sent anywhere.
Common errors
- Decode error: "Invalid percent-encoding" — the input contains a % not followed by two hex digits (e.g., "%2" or "%GZ"). Check that the encoded string is complete.
- Double-encoding: applying encode twice turns %20 into %2520. If your output has %25 where you expected a space, decode once first.
- Output differs from browser URL bar — browsers use different encode sets depending on URI position (path, query, fragment). This tool uses the most conservative encoding (RFC 3986 component set), which is safe everywhere.
- Non-ASCII characters decode to garbage — the input may be encoded with a charset other than UTF-8 (e.g., Latin-1). This tool assumes UTF-8 throughout.
FAQ
What's the difference between encodeURIComponent and this tool?
encodeURIComponent (JavaScript) leaves !, ', (, ), and ~ unencoded. This tool follows RFC 3986 strictly and encodes all reserved characters, making the output safe in any URI position. Both decode the same strings.
Why are some characters encoded and others not?
RFC 3986 defines unreserved characters (A-Z, a-z, 0-9, -, ., _, ~) that are always safe in URIs and never encoded. Everything else is encoded to avoid ambiguity with URI syntax.
Can I encode just the query string portion of a URL?
Yes — paste the full URL and the tool encodes the entire string. If you only need to encode a parameter value (e.g., the part after =), paste just that value.
What happens with emojis and non-Latin text?
They are converted to UTF-8 bytes first, then each byte is percent-encoded. For example, 🎉 is 4 UTF-8 bytes (F0 9F 8E 89) and becomes %F0%9F%8E%89. Decoding reverses this process.
Is URL encoding the same as form encoding (application/x-www-form-urlencoded)?
Not exactly. Form encoding replaces spaces with + instead of %20 and has a slightly different character set (e.g., ~ is encoded). This tool uses RFC 3986 percent-encoding, which is the standard for URIs in general.
Related tools
Prefer AllUtil on Google
One click adds AllUtil to your Google preferences. You'll see our tools highlighted with a Preferred badge in Search and AI answers.