In a URL, what does the %2C
encoding mean and what are its uses?

- 21
- 4

- 18,400
- 21
- 63
- 87
-
19The keyphrase you're looking for is "URL encoding". – BoltClock May 31 '11 at 02:23
-
5http://www.blooberry.com/indexdot/html/topics/urlencoding.htm – trutheality May 31 '11 at 02:18
-
24@TrueWill 2C || !2C – Johann Dec 02 '15 at 13:59
8 Answers
Check out http://www.asciitable.com/
Look at the Hx
, (Hex) column; 2C
maps to ,
Any unusual encoding can be checked this way
+----+-----+----+-----+----+-----+----+-----+
| Hx | Chr | Hx | Chr | Hx | Chr | Hx | Chr |
+----+-----+----+-----+----+-----+----+-----+
| 00 | NUL | 20 | SPC | 40 | @ | 60 | ` |
| 01 | SOH | 21 | ! | 41 | A | 61 | a |
| 02 | STX | 22 | " | 42 | B | 62 | b |
| 03 | ETX | 23 | # | 43 | C | 63 | c |
| 04 | EOT | 24 | $ | 44 | D | 64 | d |
| 05 | ENQ | 25 | % | 45 | E | 65 | e |
| 06 | ACK | 26 | & | 46 | F | 66 | f |
| 07 | BEL | 27 | ' | 47 | G | 67 | g |
| 08 | BS | 28 | ( | 48 | H | 68 | h |
| 09 | TAB | 29 | ) | 49 | I | 69 | i |
| 0A | LF | 2A | * | 4A | J | 6A | j |
| 0B | VT | 2B | + | 4B | K | 6B | k |
| 0C | FF | 2C | , | 4C | L | 6C | l |
| 0D | CR | 2D | - | 4D | M | 6D | m |
| 0E | SO | 2E | . | 4E | N | 6E | n |
| 0F | SI | 2F | / | 4F | O | 6F | o |
| 10 | DLE | 30 | 0 | 50 | P | 70 | p |
| 11 | DC1 | 31 | 1 | 51 | Q | 71 | q |
| 12 | DC2 | 32 | 2 | 52 | R | 72 | r |
| 13 | DC3 | 33 | 3 | 53 | S | 73 | s |
| 14 | DC4 | 34 | 4 | 54 | T | 74 | t |
| 15 | NAK | 35 | 5 | 55 | U | 75 | u |
| 16 | SYN | 36 | 6 | 56 | V | 76 | v |
| 17 | ETB | 37 | 7 | 57 | W | 77 | w |
| 18 | CAN | 38 | 8 | 58 | X | 78 | x |
| 19 | EM | 39 | 9 | 59 | Y | 79 | y |
| 1A | SUB | 3A | : | 5A | Z | 7A | z |
| 1B | ESC | 3B | ; | 5B | [ | 7B | { |
| 1C | FS | 3C | < | 5C | \ | 7C | | |
| 1D | GS | 3D | = | 5D | ] | 7D | } |
| 1E | RS | 3E | > | 5E | ^ | 7E | ~ |
| 1F | US | 3F | ? | 5F | _ | 7F | DEL |
+----+-----+----+-----+----+-----+----+-----+
-
85If you write `encodeURIComponent(",")` in your JavaScript console, then you will also get `%2C`. And with `decodeURIComponent("%2C")` you will get back the `,`. – Benny Code Jun 17 '15 at 09:26
It's the ASCII keycode in hexadecimal for a comma (,
).
You should use your language's URL encoding methods when placing strings in URLs.
You can see a handy list of characters with man ascii
. It has this compact diagram available for mapping hexadecimal codes to the character:
2 3 4 5 6 7
-------------
0: 0 @ P ` p
1: ! 1 A Q a q
2: " 2 B R b r
3: # 3 C S c s
4: $ 4 D T d t
5: % 5 E U e u
6: & 6 F V f v
7: ' 7 G W g w
8: ( 8 H X h x
9: ) 9 I Y i y
A: * : J Z j z
B: + ; K [ k {
C: , < L \ l |
D: - = M ] m }
E: . > N ^ n ~
F: / ? O _ o DEL
You can also quickly check a character's hexadecimal equivalent with:
$ echo -n , | xxd -p
2c

- 479,566
- 201
- 878
- 984
Another technique that you can use to get the symbol from url gibberish is to open Chrome
console with F12 and just paste following javascript:
decodeURIComponent("%2c")
it will decode and return the symbol (or symbols).
Hope this saves you some time.

- 58,075
- 31
- 238
- 265
In Firefox there is Ctrl+Shift+K for the Web console, then you type
;decodeURIComponent("%2c")
- mind the semicolon in the beginning
- if you Copy&Paste, you should first enable it (the console will warn you)
and you get the answer:
","

- 171
- 1
- 2
-
1
-
6Why the semicolon in the beginning? If you point reader's attention to it it would be nice to explain why. Works either way for me. – kryger Oct 26 '18 at 09:34
Simple & Easy answer,
The %2C means , comma in URL. when you add the String "abc,defg" in the url as parameter then that comma in the string which is abc , defg is changed to abc%2Cdefg .There is no need to worry about it.

- 231
- 3
- 6
In a URL, characters are changed into their ASCII values. 2C is the ASCII Code of comma(,). Hence, in URLs commas are replaced with %2C.
For example, goo,gle.com will become goo%2Cgle.com.

- 430
- 3
- 15
It's the ASCII keycode in hexadecimal for a comma (,).
i.e. , = %2C
like in my link suppose i want to order by two fields means in my link it will come like
order_by=id%2Cname which is equal to order_by=id,name .

- 139
- 2
- 11
-
3Your answer doesn't really add anything new that hasn't already been said in other, much older answers. – vijoc Feb 02 '18 at 07:00