Encodeur / Décodeur d'URL
Encodez et décodez des URL et composants URI — prend en charge l'encodage pourcent, encodeURI et encodeURIComponent.
encodeURI vs encodeURIComponent
encodeURIComponent encode tout sauf les lettres, les chiffres et - _ . ! ~ * ' ( ). Utilisez-le pour les valeurs des paramètres de requête. encodeURI préserve en plus les caractères de structure d'URL comme / ? & = # :. Utilisez-le pour les URL complètes.
FAQ
- Quand dois-je utiliser encodeURIComponent ?
- Lors de l'encodage de valeurs individuelles de paramètres de requête. Il encode & et = qui sinon casseraient l'analyse de l'URL.
- Quand dois-je utiliser encodeURI ?
- Lors de l'encodage d'une URL complète — il préserve les caractères de structure d'URL pour que l'URL reste valide.
- Qu'est-ce que %20 vs + ?
- %20 représente un espace dans les URL. + est utilisé dans l'encodage application/x-www-form-urlencoded (formulaires HTML).
À PROPOS DE CET OUTIL
Paste a URL or string to encode special characters into percent-encoded format, or decode an encoded URL back to readable text. URL encoding (percent-encoding) replaces characters outside the safe ASCII set — spaces, &, =, ?, non-Latin characters — with a % followed by their hex byte value, so a space becomes %20 and a colon becomes %3A, keeping URLs unambiguous for servers and browsers to parse. The tool distinguishes full encoding from component encoding, matching JavaScript's encodeURI versus encodeURIComponent behavior, since encoding a whole URL differs from encoding just a value going inside a query string. Handy when building query strings, sharing links with special characters, or debugging URL-related errors caused by unencoded input.
COMMENT UTILISER
- Choose Encode or Decode mode.
- Paste the URL, query string, or plain text you want to convert.
- If encoding a value meant for a single query parameter, use component encoding rather than full URL encoding so characters like & and = still get escaped.
- Click convert and review the percent-encoded or decoded output.
- Copy the result and drop it into your query string, API call, or link.
- Decode any suspicious-looking %-prefixed string from a log or browser address bar to read it in plain text.
CAS D'USAGE COURANTS
- A developer building a search feature encodes a user's query text so spaces and special characters don't break the URL.
- Someone sharing a link containing non-English characters or emoji encodes it so it pastes reliably into chat apps and emails.
- A backend engineer decodes a redirect URL parameter from server logs to see exactly what value a client sent.
- A developer debugging a broken API call notices an unencoded & inside a parameter value is truncating the request and fixes it by encoding.
- A marketer building a UTM-tagged campaign URL encodes spaces and symbols in a campaign name so the link doesn't break when shared.
CONSEILS ET ERREURS COURANTES
- encodeURIComponent (component encoding) escapes more characters, including &, =, and ?, and is what you want for individual query parameter values; encodeURI (full encoding) leaves those characters alone because it assumes they're part of the URL structure.
- Reserved characters like & and = have structural meaning in a URL — encoding them inside a value prevents them from being mistaken for a parameter separator.
- Double-encoding is a common bug: encoding an already-encoded string turns "%20" into "%2520", so check whether your input is already percent-encoded before running it through again.
- Unicode characters get encoded as multiple %XX sequences representing their UTF-8 bytes, so a single accented letter or emoji can expand into a longer percent-encoded string than you'd expect.
AUTRES QUESTIONS
- What's the difference between encodeURI and encodeURIComponent?
- encodeURI encodes a full URL and preserves characters like :, /, ?, and & since they're structurally meaningful; encodeURIComponent encodes a single component (like a query value) and escapes those same characters because they'd otherwise be misread as URL structure.
- Why did my URL break after encoding it twice?
- Encoding an already-encoded string percent-encodes the % sign itself, turning "%20" into "%2520" — always decode first if you're unsure whether a string is already encoded.
- Are all special characters encoded the same way across contexts?
- Reserved-character conventions can differ — the classic application/x-www-form-urlencoded format used by HTML forms encodes spaces as +, while RFC 3986 percent-encoding used in URL paths uses %20.
- Why does one emoji turn into a long string of % codes?
- Percent-encoding operates on UTF-8 bytes, and characters outside basic ASCII (accented letters, emoji, CJK characters) take multiple bytes, each of which becomes its own %XX sequence.