Codifica
URL Encode/Decode
Codifica e decodifica URL — caratteri da sottoporre a escape in link e parametri di query.
URL encoding (percent-encoding) replaces characters that aren't allowed in a URL — spaces, non-Latin letters, special characters — with %XX sequences, where XX is the hex code of the byte. This keeps links and query parameters from getting mangled in transit.
How to use it
- Encode: paste text or a URL and any character outside the safe ASCII set is replaced with a %XX sequence.
- Decode: paste an encoded string to see the original text.
- Encoding a full URL and encoding a single query parameter use slightly different safe-character sets — pick the mode that matches what you're encoding.
Common uses
- Building query parameters from text containing spaces, ampersands, or non-Latin characters.
- Debugging why a link with a parameter breaks — often the cause is an unencoded special character.
- Decoding URLs from third-party systems to read them in their original form.
Things to keep in mind
Encode parameter values, not the whole URL at once — otherwise you'll also encode the separators you need (:, /, ?, &).
JavaScript's encodeURIComponent and encodeURI encode different character sets — the former is meant specifically for parameter values.
Articolo su questo strumento: URL Encode/Decode: il percent-encoding nei link
Domande frequenti
Qual è la differenza tra codifica Component e URI?
La codifica Component (encodeURIComponent) esegue l'escape di quasi tutti i caratteri riservati, adatta per un singolo parametro di query o segmento di percorso. La codifica URI (encodeURI) lascia intatti caratteri come / : ? & =, poiché è pensata per codificare un URL intero che ha già una struttura.
La codifica URL è la stessa cosa di Base64?
No, vengono spesso confuse ma sono tecniche diverse. La codifica URL (percent-encoding) sostituisce i caratteri non sicuri con sequenze %XX e mantiene leggibile la maggior parte del testo ASCII, mentre Base64 ricodifica l'intero input in un alfabeto compatto — useresti Base64 URL-safe per uno scopo diverso, come incorporare dati binari in un URL.
Questo strumento invia i miei URL a un server?
No. Codifica e decodifica avvengono interamente nel tuo browser, quindi nulla di ciò che incolli qui viene trasmesso da nessuna parte.
Cos'è la doppia codifica e come riconoscerla?
È un errore che si verifica quando una stringa già codificata viene codificata di nuovo — il carattere % si trasforma in %25, e %20 diventa %2520. Il segnale del problema sono sequenze come %25XX nel risultato decodificato.
Perché lo spazio a volte è codificato come + e altre come %20?
+ per lo spazio è il formato application/x-www-form-urlencoded, usato da form e query string. %20 è il percent-encoding standard di RFC 3986, corretto in qualsiasi parte dell'URL.