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.
Бесплатный онлайн-инструмент для кодирования и декодирования URL
Мгновенно кодируйте или декодируйте любую строку URL — соответствует RFC 3986, работает в браузере, данные не отправляются на серверы.
Совет: нажмите Ctrl+Enter для кодирования, Esc для очистки
Связанные инструменты
Что такое 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 (~).
Как работает 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.
Когда необходимо кодировать URL?
Кодирование URL необходимо, когда URL содержит специальные символы, такие как пробелы, амперсанды (&), знаки равенства (=) или символы, не входящие в ASCII. Типичные сценарии включают: построение строк запросов для вызовов API, кодирование данных форм для отправки, обмен URL-адресами, содержащими специальные символы, в электронных письмах или сообщениях, а также работу с интернационализированными доменными именами.
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.
Часто кодируемые символы 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 |
URL-кодирование в языках программирования
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"Часто задаваемые вопросы
Какие символы необходимо кодировать в URL?
Символы, требующие URL-кодирования, включают пробелы, специальные символы, такие как &, =, ?, #, %, а также все символы, не входящие в ASCII. Незарезервированные символы, которые НЕ нуждаются в кодировании: A-Z, a-z, 0-9, дефис (-), подчёркивание (_), точка (.) и тильда (~).
В чём разница между %20 и + в URL?
%20 представляет пробел в пути URL и является стандартным процентным кодированием. Знак + представляет пробел только в параметрах строки запроса при использовании формата application/x-www-form-urlencoded.
URL-кодирование и Base64-кодирование — это одно и то же?
Нет. URL-кодирование преобразует специальные символы в URL в шестнадцатеричный формат %XX. Base64-кодирование преобразует двоичные данные в текстовую строку с использованием 64 печатных символов ASCII. Они служат совершенно разным целям.
Как декодировать URL в JavaScript?
Используйте decodeURIComponent() для декодирования компонента URL или decodeURI() для декодирования полного URL. Например: decodeURIComponent('%20') возвращает символ пробела.
Что такое RFC 3986?
RFC 3986 — это стандарт, определяющий синтаксис унифицированных идентификаторов ресурсов (URI). Он устанавливает, какие символы допустимы в URL и как специальные символы должны быть процентно-закодированы.
Почему в моём URL есть %3D и %26?
%3D — это URL-кодированная форма знака равенства (=), а %26 — кодированная форма амперсанда (&). Эти символы имеют специальное значение в URL, поэтому при использовании в качестве значений данных их необходимо кодировать.
Узнайте больше о URL-кодировании
Прочитайте наши подробные руководства и учебные пособия о лучших практиках URL-кодирования.
Посетите наш блог