%5D is the URL-encoded right square bracket (]).
In a URL, %5D stands for the right square bracket (]). Here is when to encode it, what it does in each part of a URL, and what every major language outputs.
Quick facts
| Character | ] |
|---|---|
| Name | Right square bracket |
| Unicode | U+005D |
| UTF-8 bytes | 5D (1 byte) |
| Percent-encoded | %5D |
| Lowercase form | %5d — identical meaning |
| Double-encoded | %255D |
| HTML form encoding | %5D |
| RFC 3986 class | Reserved — general delimiter |
What it means in a URL
The closing bracket follows the same rules as [: reserved for IPv6 hosts, encoded as %5D anywhere else.
RFC 3986 class: Reserved — general delimiter. It marks the structure of a URL (scheme, authority, path, query, fragment), so as data it must be encoded.
When to encode it
| Where it appears | What to do |
|---|---|
| Path segment | Encode |
| Query value | Encode |
| Fragment | Encode |
| Form body | Encode |
The mistake to watch for
A Markdown or wiki link that ends at a raw ] inside the URL.
What each language produces
Every function in this table encodes it. Output for the single character, UTF-8 input, tested against the real runtimes (see the encoding comparator for your own strings).
| Function | Output | |
|---|---|---|
| JavaScript encodeURIComponent(s) | %5D | encoded |
| JavaScript encodeURI(s) | %5D | encoded |
| JavaScript URLSearchParams | %5D | encoded |
| Python urllib.parse.quote(s) | %5D | encoded |
| Python quote(s, safe="") | %5D | encoded |
| Python urllib.parse.quote_plus(s) | %5D | encoded |
| PHP rawurlencode($s) | %5D | encoded |
| PHP urlencode($s) | %5D | encoded |
| Java URLEncoder.encode(s, UTF_8) | %5D | encoded |
| Go url.QueryEscape(s) | %5D | encoded |
| Go url.PathEscape(s) | %5D | encoded |
| Ruby URI.encode_www_form_component(s) | %5D | encoded |
| Ruby ERB::Util.url_encode(s) | %5D | encoded |
| C# / .NET Uri.EscapeDataString(s) | %5D | encoded |
Decoding it
decodeURIComponent('%5D') returns the right square bracket (]). Python: urllib.parse.unquote('%5D'); PHP: rawurldecode('%5D'). Paste any string into the URL decoder to decode it in your browser.
Common questions.
%5D is the percent-encoded form of the right square bracket (]), whose byte value is 0x5D. Decoding the URL turns it back into the character.
Yes. Hex digits in percent-encoding are case-insensitive, so %5d and %5D mean the same thing. RFC 3986 recommends uppercase, and mixing cases can make caches and analytics count one URL as two.
Use your language’s encoder on the value: encodeURIComponent in JavaScript gives %5D, Python’s quote(s, safe="") gives %5D, PHP’s rawurlencode gives %5D.
More from the toolkit.
About this page. Written and maintained by Sri Murugan Systems, the developer of urlencodedecode.com. Character classes follow RFC 3986 §2; language outputs were generated by running each function in its real runtime.