%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,
NameComma
UnicodeU+002C
UTF-8 bytes2C (1 byte)
Percent-encoded%2C
Lowercase form%2c — identical meaning
Double-encoded%252C
HTML form encoding%2C
RFC 3986 classReserved — 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 appearsWhat to do
Path segmentAllowed raw (encoding is also fine)
Query valueAllowed raw (encoding is also fine)
FragmentAllowed raw
Form bodyEncode

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).

FunctionOutput
JavaScript encodeURIComponent(s)%2Cencoded
JavaScript encodeURI(s),kept
JavaScript URLSearchParams%2Cencoded
Python urllib.parse.quote(s)%2Cencoded
Python quote(s, safe="")%2Cencoded
Python urllib.parse.quote_plus(s)%2Cencoded
PHP rawurlencode($s)%2Cencoded
PHP urlencode($s)%2Cencoded
Java URLEncoder.encode(s, UTF_8)%2Cencoded
Go url.QueryEscape(s)%2Cencoded
Go url.PathEscape(s)%2Cencoded
Ruby URI.encode_www_form_component(s)%2Cencoded
Ruby ERB::Util.url_encode(s)%2Cencoded
C# / .NET Uri.EscapeDataString(s)%2Cencoded

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.