URL Encoder

URL Encoder is used to encode or escape text that is normally unsafe for transmission in URL.

All processing happens on the client-side, locally in your browser. No data is uploaded.

Paste plain text below
URL encoded text

Settings

How the input is converted. Each is explained below.

History

  • 2017-08-20Tool Launched

Settings explained

Encode reserved characters

Reserved characters give a URL its structure: & and = separate the parameters of a query, ? starts it, # starts the fragment, / and : separate the parts of the address. Turn this on to encode a value that goes inside a URL, such as a search term, so that none of them break it (encodeURIComponent). Turn it off to encode a whole URL and keep its structure (encodeURI).

Input
name=Bill Gates&og=true
Encode reserved characters on
name%3DBill%20Gates%26og%3Dtrue
Encode reserved characters off
name=Bill%20Gates&og=true

Background

Certain characters need to be encoded (escaped) in URL. This is also called as Percent encoding. Read more at wikipedia

Example Substitutions

Common characters after percent-encoding (ASCII or UTF-8 based)
Character Encoded Value
newline %0A or %0D or %0D%0A
space %20
" %22
% %25
- %2D
. %2E
< %3C
> %3E
\ %5C
^ %5E
_ %5F
` %60
{ %7B
| %7C
} %7D
~ %7E

How to do URL encoding in various programming languages

LanguageEncodeDecodeExampleDocumentation
C#System.Web.HttpUtility.UrlEncode()System.Web.HttpUtility.UrlDecode()UrlEncode() UrlDecode()UrlEncode() UrlDecode()
VB .NETSystem.Web.HttpUtility.UrlEncode()System.Web.HttpUtility.UrlDecode()UrlEncode() UrlDecode()UrlEncode() UrlDecode()
Javajava.net.URLEncoder.encode()java.net.URLDecoder.decode()encode() decode()encode() decode()
JavaScriptencodeURI()decodeURI()encodeURI() decodeURI()encodeURI() decodeURI()
Pythonurllib.urlencode()urllib.unquote()urlencode() unquote()urlencode() unquote()
Rubyuri.URI.escape()uri.URI.unescape()escape() unescape()Documentation

Related tools