%2C is the URL-encoded comma (,).
In a URL, %2C stands for the comma (,). 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 | Comma |
| Unicode | U+002C |
| UTF-8 bytes | 2C (1 byte) |
| Percent-encoded | %2C |
| Lowercase form | %2c — identical meaning |
| Double-encoded | %252C |
| HTML form encoding | %2C |
| RFC 3986 class | Reserved — sub-delimiter |
What it means in a URL
The comma is a sub-delimiter, often used raw to separate list values (?ids=1,2,3). Most encoders produce %2C; encodeURI keeps it. Both forms reach the server as a comma.
RFC 3986 class: Reserved — sub-delimiter. RFC 3986 allows it raw in paths and queries, but some schemes and servers give it meaning, so encoding it as data is the safe choice.
When to encode it
| Where it appears | What to do |
|---|---|
| Path segment | Allowed raw (encoding is also fine) |
| Query value | Allowed raw (encoding is also fine) |
| Fragment | Allowed raw |
| Form body | Encode |
The mistake to watch for
Mixing styles: some APIs split ids=1,2,3 on raw commas only, so an encoded %2C inside one value is (correctly) not split — make sure the API you call agrees.
What each language produces
Left as-is by JavaScript encodeURI(s); every other function in the 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) | %2C | encoded |
| JavaScript encodeURI(s) | , | kept |
| JavaScript URLSearchParams | %2C | encoded |
| Python urllib.parse.quote(s) | %2C | encoded |
| Python quote(s, safe="") | %2C | encoded |
| Python urllib.parse.quote_plus(s) | %2C | encoded |
| PHP rawurlencode($s) | %2C | encoded |
| PHP urlencode($s) | %2C | encoded |
| Java URLEncoder.encode(s, UTF_8) | %2C | encoded |
| Go url.QueryEscape(s) | %2C | encoded |
| Go url.PathEscape(s) | %2C | encoded |
| Ruby URI.encode_www_form_component(s) | %2C | encoded |
| Ruby ERB::Util.url_encode(s) | %2C | encoded |
| C# / .NET Uri.EscapeDataString(s) | %2C | encoded |
Decoding it
decodeURIComponent('%2C') returns the comma (,). Python: urllib.parse.unquote('%2C'); PHP: rawurldecode('%2C'). Paste any string into the URL decoder to decode it in your browser.
← %2B Plus sign · Full URL encoding table · %2D Hyphen (minus) →
Common questions.
%2C is the percent-encoded form of the comma (,), whose byte value is 0x2C. Decoding the URL turns it back into the character.
Yes. Hex digits in percent-encoding are case-insensitive, so %2c and %2C 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 %2C, Python’s quote(s, safe="") gives %2C, PHP’s rawurlencode gives %2C.
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.