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.
Strumento Gratuito Online per Codifica e Decodifica URL
Codifica o decodifica istantaneamente qualsiasi stringa URL — conforme a RFC 3986, funziona nel browser, nessun dato inviato ai server.
Suggerimento: Premi Ctrl+Invio per codificare, Esc per cancellare
Strumenti Correlati
Cos'è la Codifica 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 (~).
Come Funziona la Codifica 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.
Quando è Necessario Codificare un URL?
È necessario codificare gli URL quando contengono caratteri speciali come spazi, e commerciali (&), segni di uguale (=) o caratteri non ASCII. Scenari comuni includono: costruzione di query string per chiamate API, codifica dei dati dei moduli per l'invio, condivisione di URL con caratteri speciali in email o messaggi e lavoro con nomi di dominio internazionalizzati.
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.
Caratteri URL-Encoded Comuni
| 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 |
Codifica URL nei Linguaggi di Programmazione
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"Domande Frequenti
Quali caratteri devono essere codificati nell'URL?
I caratteri che necessitano di codifica URL includono spazi, caratteri speciali come &, =, ?, #, % e tutti i caratteri non ASCII. I caratteri non riservati che NON necessitano di codifica sono: A-Z, a-z, 0-9, trattino (-), underscore (_), punto (.) e tilde (~).
Qual è la differenza tra %20 e + in un URL?
%20 rappresenta uno spazio nel percorso URL ed è il percent-encoding standard. Il segno + rappresenta uno spazio solo nei parametri della query string quando si utilizza il formato application/x-www-form-urlencoded.
La codifica URL è uguale alla codifica Base64?
No. La codifica URL converte i caratteri speciali negli URL in un formato esadecimale %XX. La codifica Base64 converte i dati binari in una stringa di testo utilizzando 64 caratteri ASCII stampabili. Servono a scopi completamente diversi.
Come si decodifica un URL in JavaScript?
Usa decodeURIComponent() per decodificare un componente URL, o decodeURI() per decodificare un URL completo. Ad esempio: decodeURIComponent('%20') restituisce un carattere spazio.
Cos'è RFC 3986?
RFC 3986 è lo standard che definisce la sintassi degli Uniform Resource Identifiers (URI). Specifica quali caratteri sono consentiti negli URL e come i caratteri speciali devono essere percent-encoded.
Perché il mio URL contiene %3D e %26?
%3D è la forma URL-encoded del segno di uguale (=) e %26 è la forma codificata della e commerciale (&). Questi caratteri hanno un significato speciale negli URL, quindi devono essere codificati quando usati come valori dati.
Scopri di Più sulla Codifica URL
Leggi le nostre guide approfondite e i tutorial sulle migliori pratiche di codifica URL.
Visita il Nostro Blog