%22 is the URL-encoded double quote (").

In a URL, %22 stands for the double quote ("). Here is when to encode it, what it does in each part of a URL, and what every major language outputs.

Quick facts

Character"
NameDouble quote
UnicodeU+0022
UTF-8 bytes22 (1 byte)
Percent-encoded%22
Lowercase form%22 — identical meaning
Double-encoded%2522
HTML form encoding%22
RFC 3986 classNot allowed in URLs
HTML entity"

What it means in a URL

A double quote is not allowed raw in a URL and must always be encoded as %22. Browsers encode it automatically in paths and queries because a raw quote would end an HTML attribute such as href="…".

RFC 3986 class: Not allowed in URLs. It is outside the characters RFC 3986 permits, so it must always be percent-encoded.

When to encode it

Where it appearsWhat to do
Path segmentEncode
Query valueEncode
FragmentEncode
Form bodyEncode

The mistake to watch for

Building a link inside HTML without encoding the quote, which closes the href attribute early and breaks the page — or opens it to injection.

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

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

Decoding it

decodeURIComponent('%22') returns the double quote ("). Python: urllib.parse.unquote('%22'); PHP: rawurldecode('%22'). Paste any string into the URL decoder to decode it in your browser.

← %21 Exclamation mark  ·  Full URL encoding table  ·  %23 Hash (number sign) →

Common questions.

%22 is the percent-encoded form of the double quote ("), whose byte value is 0x22. Decoding the URL turns it back into the character.

Yes. Hex digits in percent-encoding are case-insensitive, so %22 and %22 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 %22, Python’s quote(s, safe="") gives %22, PHP’s rawurlencode gives %22.

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.