Why URLs Contain Percent Signs: Percent-Encoding Explained
%20, %2F and %40 are not errors — they are characters encoded so they survive a URL. What the common codes mean, and when a literal % must be escaped too.
ProfitTool Team
Developer Tools
What Percent-Encoding Is
A URL can only contain a restricted set of characters: letters, digits, and a handful of symbols (-._~:/?#[]@!$&'()*+,;=). Any other character must be encoded as a percent sign followed by two hexadecimal digits representing the character's UTF-8 byte value.
Common Percent-Encoded Characters
| Character | Encoded | Where it appears |
|---|---|---|
| Space | %20 | Search queries: q=hello%20world |
| @ | %40 | Emails in URLs, database connection strings |
| / | %2F | Forward slash when used as data (not path separator) |
| ? | %3F | Question mark when used as data |
| & | %26 | Ampersand in query values |
| = | %3D | Equals sign in query values |
| + | %2B | Literal plus (+ is used for spaces in forms) |
| # | %23 | Hash sign when used as data |
| % | %25 | Literal percent sign |
| : | %3A | Colon in query values |
Why Your @ in a Password Breaks URLs
If your database password contains @, a connection string like:
postgresql://user:p@ss@host/dbIs ambiguous — the parser does not know which @ separates the credentials from the host. Encode it as %40:
postgresql://user:p%40ss@host/dbThis is exactly why the Shahjahan78900@ password in a DATABASE_URL must be written as Shahjahan78900%40.
Plus Sign vs %20
In application/x-www-form-urlencoded (standard HTML form submission), spaces are encoded as +. In standard percent-encoding (URLs), spaces are %20. Both are correct in their contexts — mixing them up causes decoding errors.
Use our URL Encoder / Decoder to safely encode any string for use in URLs.
ProfitTool Team
Developer ToolsWritten and maintained by the ProfitTool team. Where an article references a ProfitTool utility, the behaviour described is the behaviour of the tool on this site — you can open it and check the output yourself.
More from the Knowledge Hub
URL Encoding Explained: What Are Percent-Encoded Characters?
Percent-encoding converts characters that cannot appear literally in a URL into %XX form. How it works, and when to use encodeURIComponent over encodeURI.
Developer ToolsBase64 Encoding Explained: What It Is and How It Works
Base64 turns binary into 64 safe ASCII characters, at a 33% size cost. How the encoding works, what padding is for, and how Base64URL differs.
Developer ToolsDemystifying Cron Schedules: How to Generate and Debug Linux Crontabs with AI
A complete engineer's reference to cron expressions. Learn crontab syntax, special strings (@daily, @reboot), timezones, and how to generate schedule expressions with AI.