NathanTools

URL Encode & Decode

Encode special characters for safe use in URLs and query strings, or paste a percent-encoded URL to decode it and see every parameter.

100% free No sign-up Works on any device

Report a bug

URL Encode / Decode

Input

Output

Converts as you type. Nothing leaves your browser. Ctrl + Enter copies the result.

Encode escapes everything except letters, digits and - _ . ~, which is right for a single query value. Encode full URL keeps : / ? & = # so the address still works. Each line is converted separately.

Updated November 2026 · Follows RFC 3986 · Runs in your browser

How to URL encode or decode

  1. Paste your text, query value or URL into the Input box. Press Sample to try an example.
  2. Choose Encode for a single value, Encode full URL for a whole address, or Decode to turn %XX codes back into readable text.
  3. Paste a full URL and the URL breakdown lists its host, path and every query parameter, already decoded.
  4. Press Copy or Download. Use Swap to feed the output back in, for example to check that decoding gives the original text.

How percent-encoding works

A URL may only contain a limited set of ASCII characters. Anything else is converted to its UTF-8 bytes, and each byte is written as % plus two hexadecimal digits. Plain letters take one byte, accented letters two, most Asian characters three and emoji four:

CharacterEncodedCharacterEncoded
space%20 (or + in forms)&%26
!%21=%3D
"%22?%3F
#%23@%40
$%24/%2F
%%25:%3A
+%2Bé%C3%A9
,%2C€%E2%82%AC

Reserved and unreserved characters

RFC 3986, the standard for URLs, sorts characters into three groups:

  • Unreserved: A–Z a–z 0–9 - . _ ~. Always safe, never need encoding.
  • Reserved: : / ? # [ ] @ ! $ & ' ( ) * + , ; =. They separate the parts of a URL, so they must be encoded when they appear inside a value. A search for "R&D" has to be sent as q=R%26D, otherwise the server sees a new parameter called D.
  • Everything else (spaces, quotes, < >, accented letters, emoji) must always be encoded.

Encode vs Encode full URL

Encode (encodeURIComponent)Encode full URL (encodeURI)
Use forOne value: a search term, a name, a URL inside a parameterA complete address with spaces or non-English characters
/ ? & = : #EncodedKept
Input a b&ca%20b%26ca%20b&c

A common bug is running a whole URL through Encode: the result https%3A%2F%2F… is no longer a working link. Another is encoding twice, which turns %20 into %2520.

URL encoding in code

LanguageEncode a valueDecode
JavaScriptencodeURIComponent(s)decodeURIComponent(s)
Pythonurllib.parse.quote(s, safe="")urllib.parse.unquote(s)
PHPrawurlencode($s) (%20) or urlencode($s) (+)rawurldecode($s)
C# / .NETUri.EscapeDataString(s)Uri.UnescapeDataString(s)
JavaURLEncoder.encode(s, UTF_8) (+ for spaces)URLDecoder.decode(s, UTF_8)

For HTML special characters such as < and & inside a web page, use the HTML entity encoder instead; for binary data, use Base64.

Frequently asked questions

URL encoding, also called percent-encoding, replaces characters that aren't allowed or have a special meaning in a URL with a % sign and two hexadecimal digits. A space becomes %20, & becomes %26 and é becomes %C3%A9 (its two UTF-8 bytes). It lets any text travel safely inside a link or query string.

%20 is the standard percent-encoding for a space and works anywhere in a URL. + means a space only in query strings sent by HTML forms (application/x-www-form-urlencoded). Tick "Spaces as +" when you're building form data; otherwise use %20. When decoding, this tool treats + as a space.

Use Encode for a single value you're putting into a URL, such as a search term or a redirect address in a query parameter: it escapes / ? & = so they can't break the URL. Use Encode full URL when you have a complete address with spaces or accented letters and want it to stay a working link.

%25 is an encoded percent sign, which usually means the text was encoded twice (double encoding): %20 became %2520. Decode it twice, and fix the code so it encodes the value only once.

Unreserved characters never need encoding: A–Z, a–z, 0–9, hyphen (-), full stop (.), underscore (_) and tilde (~). Everything else should be encoded inside a value. JavaScript's encodeURIComponent also leaves ! ' ( ) * alone; tick "Strict RFC 3986" to encode those too.

No. Encoding and decoding run in your browser with the standard JavaScript functions. Nothing is sent to our server.

Comments

No comments yet.

Share this tool

URL Encode / Decode

Favorites

Drag to reorder, or use the arrows. Categories and the tools inside them can both be moved.

Saved in this browser. Sign in to keep them on every device.

Esc
↑ ↓ to moveEnter to open