URL Encoder & Decoder

Percent-encode text for URLs, or decode an escaped URL back to plain text.

Text or Encoded URL

URL Encoding

Output Result

Why URLs need escaping at all

A URL has a grammar. Characters such as ?, &, =, # and / mark structure — where the query begins, where one parameter ends and the next starts, where the fragment starts. When those same characters appear inside a value, they have to be escaped or the URL parses wrongly.

Percent-encoding replaces each unsafe byte with % followed by two hex digits. A space becomes %20, an ampersand %26. Non-ASCII characters are encoded as their UTF-8 bytes, which is why a single accented letter often becomes two escapes.

This tool uses encodeURIComponent, the right choice for a single query parameter value or path segment. It escapes &, =, ? and / too — so do not run it over a whole URL, or you will escape the very delimiters that make it work.

RFC 3986 Percent-Encoding Character Reference

The Uniform Resource Identifier (URI) specification (RFC 3986) classifies characters into reserved (structural characters with syntactic meaning) and unreserved (safe literals). Reserved characters must be percent-encoded when used within data values.

CharacterPercent CodeRFC 3986 Description / Syntactic Role
Space%20Standard URL space (do not use + in URL paths)
/%2FPath segment delimiter
?%3FQuery string prefix indicator
&%26Query parameter separator
=%3DQuery key-value pair delimiter
:%3AScheme and port separator
#%23URL fragment / hash identifier
%%25Percent character (escape prefix itself)
+%2BPlus sign (often parsed as space in legacy forms)

How to URL Encode in Major Programming Languages

If you are building API requests or web scraping scripts, here is how to perform percent-encoding natively:

// JavaScript / TypeScript:
const encoded = encodeURIComponent("Hello World & Good Morning!");
const decoded = decodeURIComponent(encoded);
# Python 3:
import urllib.parse
encoded = urllib.parse.quote("Hello World & Good Morning!")
decoded = urllib.parse.unquote(encoded)

Frequently asked questions

What is the difference between encodeURI and encodeURIComponent?

encodeURI escapes a complete URL and deliberately leaves structural characters like / ? & = intact. encodeURIComponent escapes those too, which is what you want for an individual parameter value. This tool uses encodeURIComponent.

Why is a space sometimes %20 and sometimes +?

%20 is the correct percent-encoding everywhere in a URL. The + convention comes from HTML form submission and is only valid in a query string. This tool always produces %20.

Why did one character become several % escapes?

Non-ASCII characters are encoded as UTF-8 bytes, and most need two to four bytes. An é becomes %C3%A9 — two escapes for one character.

Why does decoding throw an error?

decodeURIComponent rejects malformed input — a stray % not followed by two hex digits, or a truncated escape sequence. Check that every % has exactly two hex characters after it.

Can I encode a whole URL with this?

Not usefully. It will escape the :// and the ? and & delimiters, producing a string that is no longer a working URL. Encode individual parameter values instead.