%2D in a URL
The percent-encoded hyphen (-).
Short answer
%2D is the percent-encoded hyphen (-). A hyphen is an unreserved character, so it never needs encoding and every common encoding function leaves it alone. RFC 3986 says %2D and - are equivalent, so a %2D in a URL can safely be written as -.
- Character
- -
- Percent-encoded
- %2D
- Byte value
- 0x2D = 45
- RFC 3986 class
- unreserved
- UTF-8 bytes
- 1
Where you will see it
- URLs produced by over-eager encoders that escape every character that is not a letter or digit.
- Hand-built URLs where a hyphen was encoded by mistake: my%2Dfile.pdf.
- Dates and slugs that went through such an encoder: 2026%2D11%2D18.
What goes wrong
- Not every server normalises %2D to - before matching routes or cache keys, so /my%2Dpage and /my-page can reach different handlers or miss the cache. Use the plain hyphen.
- If you are writing an encoder, leave A–Z a–z 0–9 - . _ ~ alone. RFC 3986 says URIs that differ only in encoding these characters are equivalent and should be normalised by decoding them.
Decoded examples
| Encoded | Decodes to | What it is | Open in the decoder |
|---|---|---|---|
| my%2Dfile.pdf | my-file.pdf | A file name with an unnecessarily encoded hyphen. | Open in decoder |
| 2026%2D11%2D18 | 2026-11-18 | A date that went through an over-eager encoder. | 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 | kept |
| JavaScript | encodeURI | kept |
| JavaScript | URLSearchParams | kept |
| JavaScript | escape (deprecated) | kept |
| Python | quote (default safe='/') | kept |
| Python | quote (safe='') | kept |
| Python | quote_plus | kept |
| C# | Uri.EscapeDataString | kept |
| C# | WebUtility.UrlEncode | kept |
| C# | HttpUtility.UrlEncode | kept |
Questions
Do I need to URL encode a dash?
No. A hyphen is unreserved in RFC 3986 and never needs encoding. encodeURIComponent, Python's quote and Uri.EscapeDataString all leave it as -.
Is %2D the same as -?
Yes. RFC 3986 says URIs that differ only by percent-encoding an unreserved character are equivalent, so %2D should be treated exactly like -.
Decode or encode your own text
Paste anything containing %2D. It runs in your browser; nothing is uploaded.
Related characters
%2C
comma
%2C is the percent-encoded comma (,).
%20
space
%20 is the percent-encoded space character.
%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.