%2C in a URL
The percent-encoded comma (,).
Short answer
%2C is the percent-encoded comma (,). A comma is a sub-delimiter that many APIs use to separate list items, so whether a comma in your data should be encoded depends on how the receiver splits the list.
- Character
- ,
- Percent-encoded
- %2C
- Byte value
- 0x2C = 44
- RFC 3986 class
- sub-delim
- UTF-8 bytes
- 1
Where you will see it
- Lists in query values: ids=1%2C2%2C3.
- CSV-like parameters: fields=name%2Cemail.
- Output of encodeURIComponent; encodeURI leaves commas alone.
What goes wrong
- %2C and , decode to the same character, but a receiver that splits a list on a literal comma before percent-decoding treats them differently. If a value can contain a comma, encode it and confirm how the API reads lists.
- A comma is legal unencoded in a query string, so a list written as ids=1,2,3 is valid. Encoding it is a style choice unless the API requires one form.
Decoded examples
| Encoded | Decodes to | What it is | Open in the decoder |
|---|---|---|---|
| ids=1%2C2%2C3 | ids=1,2,3 | A comma-separated list with encoded commas. | Open in decoder |
| name=Doe%2C%20Jane | name=Doe, Jane | A name that contains a comma. | Open in decoder |
How each language encodes ,
Outputs below come from running each function, not from documentation. “Kept” means the function leaves the character as it is. Compare every character across every function.
| Language | Function | Output for , |
|---|---|---|
| JavaScript | encodeURIComponent | %2C |
| JavaScript | encodeURI | kept |
| JavaScript | URLSearchParams | %2C |
| JavaScript | escape (deprecated) | %2C |
| Python | quote (default safe='/') | %2C |
| Python | quote (safe='') | %2C |
| Python | quote_plus | %2C |
| C# | Uri.EscapeDataString | %2C |
| C# | WebUtility.UrlEncode | %2C |
| C# | HttpUtility.UrlEncode | %2c |
Questions
Should I encode commas in a query string?
It depends on the API. Commas are allowed unencoded, and many APIs expect lists as a,b,c. If a comma can appear inside a value, encode it so it is not mistaken for a list separator.
Is %2C the same as a comma?
After decoding, yes. Before decoding, a literal comma may be treated as a delimiter while %2C is plain data, depending on how the server parses the query.
Decode or encode your own text
Paste anything containing %2C. It runs in your browser; nothing is uploaded.
Related characters
%3D
equals sign
%3D is the percent-encoded equals sign (=).
%26
ampersand
%26 is the percent-encoded ampersand (&).
%2B
plus sign
%2B is the percent-encoded plus sign (+).
All percent-encoded characters · Full percent-encoding table · What is URL encoding?
Behaviour checked against RFC 3986, the WHATWG URL Standard and MDN. Updated November 4, 2026
Tools
URL Encoder
Percent-encode a value, a full URL or form data, with strict RFC 3986 and +/%20 options.
URL Parser
Split a URL into scheme, host, port, path, query and fragment, with checks for common problems.
Query String Parser
Edit query parameters as a table, rebuild the string, or export it as JSON.
Base64 Encode/Decode
Convert text to Base64 and back, including the URL-safe Base64URL alphabet.
HTML Encode/Decode
Escape text to HTML entities and decode entities back to text.
JWT Decoder
Read a JSON Web Token's header and payload and check its expiry.