%url-decoder.net

%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

EncodedDecodes toWhat it isOpen in the decoder
my%2Dfile.pdfmy-file.pdfA file name with an unnecessarily encoded hyphen.Open in decoder
2026%2D11%2D182026-11-18A 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.

LanguageFunctionOutput for -
JavaScriptencodeURIComponentkept
JavaScriptencodeURIkept
JavaScriptURLSearchParamskept
JavaScriptescape (deprecated)kept
Pythonquote (default safe='/')kept
Pythonquote (safe='')kept
Pythonquote_pluskept
C#Uri.EscapeDataStringkept
C#WebUtility.UrlEncodekept
C#HttpUtility.UrlEncodekept

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

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