URLEncoder.tools is a free online URL encoder and decoder that converts special characters in URLs to their percent-encoded equivalents as defined by RFC 3986. It supports five encoding modes: Standard URL Encode (encodeURIComponent), Full URL Encode (encodeURI), URL Decode, Batch Mode for multiple URLs, and Form Data Encode. All processing happens client-side in the browser with zero data sent to any server. The tool supports 12 languages and works with Unicode characters including emoji.
Outil Gratuit d'Encodage et Décodage d'URL en Ligne
Encodez ou décodez instantanément n'importe quelle chaîne URL — conforme RFC 3986, fonctionne dans votre navigateur, aucune donnée envoyée aux serveurs.
Astuce : Appuyez sur Ctrl+Entrée pour encoder, Échap pour effacer
Outils Connexes
Qu'est-ce que l'Encodage d'URL ?
URL encoding (also called percent-encoding) is a method of converting special characters in a URL into a format that can be safely transmitted over the internet. It replaces unsafe ASCII characters with a percent sign (%) followed by two hexadecimal digits representing the character's byte value, as defined by RFC 3986.
For example, a space character becomes %20, an ampersand (&) becomes %26, and a question mark (?) becomes %3F. The unreserved characters that do not require encoding are: A-Z, a-z, 0-9, hyphen (-), underscore (_), period (.), and tilde (~).
Comment Fonctionne l'Encodage d'URL ?
URL encoding works by converting each character to its UTF-8 byte sequence, then representing each byte as a percent sign followed by two hexadecimal digits. Single-byte ASCII characters like a space produce one percent-encoded triplet (%20), while multi-byte Unicode characters produce multiple triplets.
RFC 3986 divides characters into two groups: reserved characters (: / ? # [ ] @ ! $ & ' ( ) * + , ; =) that have special meaning in URL syntax, and unreserved characters (A-Z, a-z, 0-9, -, _, ., ~) that can appear in URLs without encoding. Reserved characters must be percent-encoded when used as data rather than as delimiters.
Quand Faut-il Encoder une URL ?
Vous devez encoder les URLs lorsqu'elles contiennent des caractères spéciaux comme des espaces, des esperluettes (&), des signes égal (=) ou des caractères non ASCII. Les scénarios courants incluent : la construction de chaînes de requête pour les appels API, l'encodage de données de formulaire pour soumission, le partage d'URLs contenant des caractères spéciaux dans les e-mails ou les messages, et le travail avec des noms de domaine internationalisés.
Query Strings & API Calls
When building REST API requests, query parameters containing special characters like &, =, or spaces must be percent-encoded to avoid breaking the URL structure.
Form Data Submission
HTML forms submitted via GET method encode field values as query parameters. Spaces become + or %20, and special characters are percent-encoded.
Email & Messaging Links
URLs shared in emails or chat messages often contain special characters that need encoding to remain clickable and functional.
JavaScript fetch() & AJAX
When constructing URLs dynamically in JavaScript, always use encodeURIComponent() for parameter values to prevent XSS and malformed requests.
Caractères Couramment Encodés dans les URL
| Character | Encoded | Unicode |
|---|---|---|
| (space) | %20 | U+0020 |
| ! | %21 | U+0021 |
| # | %23 | U+0023 |
| $ | %24 | U+0024 |
| & | %26 | U+0026 |
| + | %2B | U+002B |
| , | %2C | U+002C |
| / | %2F | U+002F |
| : | %3A | U+003A |
| ; | %3B | U+003B |
| = | %3D | U+003D |
| ? | %3F | U+003F |
| @ | %40 | U+0040 |
| [ | %5B | U+005B |
| ] | %5D | U+005D |
Encodage d'URL dans les Langages de Programmation
JavaScript
encodeURIComponent('hello world')
// → "hello%20world"
decodeURIComponent('hello%20world')
// → "hello world"
encodeURI('https://example.com/search?q=hello world')
// → "https://example.com/search?q=hello%20world"Python
from urllib.parse import quote, unquote
quote('hello world')
# → "hello%20world"
unquote('hello%20world')
# → "hello world"PHP
urlencode('hello world');
// → "hello+world"
rawurlencode('hello world');
// → "hello%20world"
urldecode('hello%20world');
// → "hello world"Java
URLEncoder.encode("hello world", "UTF-8");
// → "hello+world"
URLDecoder.decode("hello+world", "UTF-8");
// → "hello world"C#
Uri.EscapeDataString("hello world");
// → "hello%20world"
Uri.UnescapeDataString("hello%20world");
// → "hello world"Ruby
require 'uri'
URI.encode_www_form_component('hello world')
# → "hello+world"
URI.decode_www_form_component('hello+world')
# → "hello world"Foire Aux Questions
Quels caractères doivent être encodés dans une URL ?
Les caractères nécessitant un encodage URL incluent les espaces, les caractères spéciaux comme &, =, ?, #, % et tous les caractères non ASCII. Les caractères non réservés qui n'ont PAS besoin d'encodage sont : A-Z, a-z, 0-9, tiret (-), underscore (_), point (.) et tilde (~).
Quelle est la différence entre %20 et + dans une URL ?
%20 représente un espace dans le chemin de l'URL et est l'encodage en pourcentage standard. Le signe + représente un espace uniquement dans les paramètres de chaîne de requête lors de l'utilisation du format application/x-www-form-urlencoded.
L'encodage URL est-il identique à l'encodage Base64 ?
Non. L'encodage URL convertit les caractères spéciaux des URLs en un format hexadécimal %XX. L'encodage Base64 convertit des données binaires en une chaîne de texte utilisant 64 caractères ASCII imprimables. Ils servent des objectifs entièrement différents.
Comment décoder une URL en JavaScript ?
Utilisez decodeURIComponent() pour décoder un composant d'URL, ou decodeURI() pour décoder une URL complète. Par exemple : decodeURIComponent('%20') renvoie un caractère d'espace.
Qu'est-ce que RFC 3986 ?
RFC 3986 est le standard qui définit la syntaxe des Identifiants Uniformes de Ressource (URIs). Il spécifie quels caractères sont autorisés dans les URLs et comment les caractères spéciaux doivent être encodés en pourcentage.
Pourquoi mon URL contient-elle %3D et %26 ?
%3D est la forme encodée du signe égal (=) et %26 est la forme encodée de l'esperluette (&). Ces caractères ont une signification spéciale dans les URLs et doivent donc être encodés lorsqu'ils sont utilisés comme valeurs de données.
En Savoir Plus sur l'Encodage d'URL
Lisez nos guides approfondis et tutoriels sur les meilleures pratiques d'encodage d'URL.
Visitez Notre Blog