Skip to content

URL Encoder/Decoder

Encodage et decodage d'URLs et de parametres.

Encodage URL

Decodage URL

Analyseur d'URL

Reference encodage

Caracteres reserves

Caractere Encode Description
(espace) %20 ou + Espace
! %21 Point d'exclamation
# %23 Hash/Fragment
$ %24 Dollar
% %25 Pourcent
& %26 Esperluette
' %27 Apostrophe
( %28 Parenthese ouvrante
) %29 Parenthese fermante
* %2A Asterisque
+ %2B Plus
, %2C Virgule
/ %2F Slash
: %3A Deux-points
; %3B Point-virgule
= %3D Egal
? %3F Point d'interrogation
@ %40 Arobase
[ %5B Crochet ouvrant
] %5D Crochet fermant

Caracteres speciaux

Caractere Encode Description
é %C3%A9 e accent aigu (UTF-8)
è %C3%A8 e accent grave
à %C3%A0 a accent grave
ç %C3%A7 c cedille
%E2%82%AC Euro

Difference encodeURI vs encodeURIComponent

// encodeURI - preserve URL structure
encodeURI("https://example.com/path?q=hello world")
// "https://example.com/path?q=hello%20world"

// encodeURIComponent - encode everything
encodeURIComponent("https://example.com/path?q=hello world")
// "https%3A%2F%2Fexample.com%2Fpath%3Fq%3Dhello%20world"

Quand utiliser quoi

  • encodeURIComponent : pour les valeurs de parametres
  • encodeURI : pour une URL complete (preserve :/?#)

CLI

# Python
python -c "import urllib.parse; print(urllib.parse.quote('hello world'))"

# Curl (auto-encode)
curl -G --data-urlencode "q=hello world" https://example.com

# PowerShell
[System.Uri]::EscapeDataString("hello world")