World’s largest virtual agentic engineering & quality conference

WHENAUG 19-21
WHEREVirtual · Global
WATCH NOW

URL Encode

URL encoding provides a way to convert special characters into a format that can be sent over the Internet. It is brought to you by TestMu AI (formerly LambdaTest), the team behind a unified software testing platform.

Categories

...

3000+ Browsers. One Platform.

See exactly how your site performs everywhere.

Try it free
...

Write Tests in Plain English with KaneAI

Create, debug, and evolve tests using natural language.

Try for free
...
TestMu Conf 2026

World's largest virtual agentic engineering & quality conference

...

AUG 19-21, 2026

WATCH NOW

Input

ConvertEncode

Copy Copy to Clipboard

Reset Reset

Output

What is URL Encode Online?

URL encoding stands for replacing certain characters in a URL with character triplets that consist of the % character followed by two hexadecimal digits. These hexadecimal digits represent the numeric values of the replaced characters. URL encoding is also called percent encoding because it uses % as an escape character.

How does URL Encode Online work?

URL addresses can only be copied over to the Internet if they use ASCII characters. These addresses contain characters outside the ASCII set, so they must first be converted into an ASCII format. URL encoding replaces unsafe ASCII characters with a percent sign (%) followed by two hexadecimal digits.

What is a URL?

A URL (Uniform Resource Locator) is the address of a specific web page or file on the Internet. It is used to search and retrieve information on the World Wide Web. URLs usually include a protocol (such as "http" or "https"), a domain name, and sometimes the path to a specific file or resource.

Why is the URL Encode Online tool needed?

URL Encode online tool is used to convert certain characters in a URL to their corresponding hexadecimal representation. This is necessary because some characters, such as spaces and some special characters, are not allowed in URLs. It is also used to easily convert these characters into their encoded form, allowing them to be safely included in a URL.

URL encoding vs. decoding: what is the difference?

URL encoding and URL decoding are opposite operations. Encoding takes readable text and replaces every reserved or unsafe character with a percent-encoded triplet - a % sign followed by the two-digit hexadecimal ASCII code of the character (for example a space becomes %20 and an ampersand becomes %26). Decoding does the reverse: it reads those triplets and restores the original characters so the value is human-readable again.

The tool on this page handles the encoding direction - paste raw text and it returns a percent-encoded string that is safe to drop into a URL. When you need to go the other way and expand %20, %26 or %3D back into spaces and symbols, use our URL Decode tool.

Reserved vs. unreserved characters in URL encoding

RFC 3986, the specification that defines the URI syntax, sorts the characters allowed in a URL into two groups. Reserved characters have a special meaning in a URI and act as delimiters: the general delimiters : / ? # [ ] @ and the sub-delimiters ! $ & ' ( ) * + , ; = . When one of these characters appears as data rather than as a delimiter, it must be percent-encoded so it is not misread.

Unreserved characters never need encoding. They are the uppercase and lowercase letters A-Z and a-z, the digits 0-9, and the four symbols hyphen ( - ), period ( . ), underscore ( _ ) and tilde ( ~ ). The encoder above leaves these unreserved characters untouched and only rewrites the characters that could break a URL. Non-ASCII characters (such as accented letters or emoji) are first converted to their UTF-8 bytes, and each byte is then percent-encoded.

Common URL encoding reference table (ASCII to percent-encoding)

The table below lists the characters people most often need to encode, the hexadecimal value of their ASCII code, and the percent-encoded output this tool produces.

CharacterNameASCII (hex)URL-encoded
(space)Space20%20
"Double quote22%22
#Hash / fragment23%23
$Dollar24%24
%Percent25%25
&Ampersand26%26
+Plus2B%2B
,Comma2C%2C
/Slash2F%2F
:Colon3A%3A
;Semicolon3B%3B
=Equals3D%3D
?Question mark3F%3F
@At sign40%40

One character behaves differently depending on context: a space becomes %20 in a URL path or query (the output this tool produces), but it becomes a plus sign ( + ) when data is submitted through an HTML form. That form variant is explained below.

How to encode URLs programmatically (JavaScript, Python, and C#)

When you need URL encoding inside your own code rather than through this tool, every major language ships a built-in function. The examples below encode a single value for safe use in a query string.

JavaScript (encodeURIComponent)

Use encodeURIComponent for individual values - it also encodes / ? : & = - and encodeURI when you want to keep an already-valid URL structure intact. This tool is built on encodeURIComponent.

const raw = "https://example.com/search?q=hello world&lang=en";
const encoded = encodeURIComponent(raw);
// https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dhello%20world%26lang%3Den

// encodeURI keeps the characters that build a valid URL (: / ? &) intact
encodeURI("https://example.com/my page.html");
// https://example.com/my%20page.html

Python (urllib.parse)

Python exposes URL encoding through urllib.parse. Use quote for path-style encoding and quote_plus when you need spaces as plus signs for form data.

from urllib.parse import quote, quote_plus

quote("hello world/?q=a&b")      # 'hello%20world/%3Fq%3Da%26b'
quote("hello world", safe="")    # 'hello%20world'
quote_plus("hello world")        # 'hello+world'  (space -> +, for form data)

C# (HttpUtility.UrlEncode)

In .NET, HttpUtility.UrlEncode performs form-style encoding (spaces become +), while Uri.EscapeDataString follows RFC 3986 and encodes spaces as %20.

using System;
using System.Web;   // HttpUtility lives in System.Web

// Form-style encoding: spaces become "+"
string a = HttpUtility.UrlEncode("hello world");   // "hello+world"

// RFC 3986 encoding: spaces become "%20"
string b = Uri.EscapeDataString("hello world");    // "hello%20world"

What is the application/x-www-form-urlencoded media type?

application/x-www-form-urlencoded is the default MIME type used when an HTML form is submitted with an HTTP POST (or appended to the URL on a GET request). The browser serialises the form into key=value pairs, joins the pairs with an ampersand ( & ), and percent-encodes the keys and values - with one notable difference from standard URL encoding: spaces are written as a plus sign ( + ) instead of %20.

For example, a form with a name field of Ada Lovelace and a role field of R&D lead is encoded as the body below. Note the + for each space and the %26 for the literal ampersand inside the value:

name=Ada+Lovelace&role=R%26D+lead

Because this tool targets URLs rather than form bodies, it encodes spaces as %20. When you specifically need the form-body variant, use the plus-for-space output shown by the quote_plus and HttpUtility.UrlEncode functions above.

Frequently Asked Questions

Did you find this page helpful?

More Tools

Related Tools
AI Agent Tools
Code Formatters & Minifiers

TestMu AI forEnterprise

Get access to solutions built on Enterprise
grade security, privacy, & compliance

  • Advanced access controls
  • Advanced data retention rules
  • Advanced Local Testing
  • Premium Support options
  • Early access to beta features
  • Private Slack Channel
  • Unlimited Manual Accessibility DevTools Tests