URL Encoder and Decoder: Free Online Tool

Paste any text or URL. Get the encoded or decoded version instantly. No account needed, nothing to download.

Output

Your encoded URL will appear here

What is URL encoding?

URL encoding converts characters that can't be safely transmitted in a URL into a percent-encoded format. A space becomes %20. The @ symbol becomes %40. The # becomes %23.

Every URL can only contain a limited set of ASCII characters. Anything outside that set (spaces, special characters, non-ASCII letters) has to be encoded before it can travel safely across the internet.

The technical name for this is percent-encoding, because every encoded character starts with a % followed by 2 hexadecimal digits representing its byte value.

How URL encoding works

When a character gets URL-encoded, here's what happens:

  1. The character is converted to its byte value in UTF-8
  2. Each byte gets written as % followed by the hexadecimal value

So a space (byte value 32 in decimal, 20 in hex) becomes %20. The euro sign (3 bytes in UTF-8: E2, 82, AC) becomes %E2%82%AC.

Most URL encoders today use UTF-8, which means they can handle any character in any language. Old encoders sometimes used ASCII or ISO-8859-1, which caused problems with international characters. UTF-8 is the standard now per RFC 3629.

Reserved vs unreserved characters in a URL

Not all characters need encoding. URLs recognize 2 categories.

Unreserved characters never need encoding. They can appear in a URL as-is:

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
a b c d e f g h i j k l m n o p q r s t u v w x y z
0 1 2 3 4 5 6 7 8 9 - _ . ~

Reserved characters have special meaning in a URL. If you're using them as data (not as URL structure), they need encoding:

CharacterEncoded formMeaning in URL
/%2FPath separator
?%3FQuery string start
#%23Fragment identifier
&%26Query param separator
=%3DKey-value separator
+%2BSpace (in form data)
@%40Used in email and auth
:%3AProtocol separator
;%3BParam separator
,%2CValue list separator

This list comes from RFC 3986 (January 2005), the current standard for Uniform Resource Identifier (URI) syntax.

Percent-encoded characters: quick reference

The most common characters you'll encounter:

CharacterEncoded formNotes
Space%20Also written as + in form data
!%21Reserved
"%22
#%23Reserved
$%24Reserved
%%25Must encode the percent sign itself
&%26Reserved
'%27
(%28
)%29
*%2A
+%2BReserved
,%2CReserved
/%2FReserved
:%3AReserved
;%3BReserved
<%3C
=%3DReserved
>%3E
?%3FReserved
@%40Reserved
[%5BReserved
\%5C
]%5DReserved
^%5E
`%60
{%7B
|%7C
}%7D
~%7EUnreserved but sometimes encoded

What is URL decoding?

URL decoding is the reverse. It takes a percent-encoded string and converts it back to human-readable text.

Hello%20World%21 decodes to Hello World!. user%40example.com decodes to user@example.com.

You'll use this most often when debugging API responses or trying to understand what's in a URL that arrived at your server.

URL encoding vs URL decoding

URL encodingURL decoding
DirectionPlain text to percent-encodedPercent-encoded to plain text
When to useBefore sending data in a URLAfter receiving an encoded URL
Examplehello world → hello%20worldhello%20world → hello world

Encode before sending. Decode after receiving.

Why is URL encoding important?

A URL can only contain characters from a specific ASCII subset. If your data contains anything outside that range (a space, a #, or a non-English character), the URL either breaks or is misinterpreted.

Say you're passing a user's email address as a query parameter: ?email=user@domain.com. The @ sign isn't a reserved character in a query string, but many servers and proxies will misread it. Encoded: ?email=user%40domain.com. Now it's unambiguous.

Or a search query with C# programming. Without encoding: ?q=C# programming. The # tells the browser you've started a fragment, so the server never sees "programming". Encoded: ?q=C%23%20programming. The server gets the whole thing.

When do you actually need URL encoding?

API query parameters

Any time you pass user input as a URL parameter, encode it. Search terms, email addresses, anything that might contain spaces or special characters.

OAuth and authentication tokens

Access tokens sometimes contain + and = characters. If you paste them raw into a redirect URI, they'll be misinterpreted. Encode them first.

HTML form submissions

When a form submits via GET, the browser automatically encodes the data as application/x-www-form-urlencoded. Spaces become +, everything else gets percent-encoded. This is why + and %20 both represent spaces, depending on context.

Email links

mailto: links with pre-filled subjects need encoding. A subject like Meeting at 3 pm? becomes subject=Meeting%20at%203pm%3F.

Webhook payloads

If you're building a redirect URL and need to pass a callback URL as a parameter, encode the entire callback URL. A URL inside a URL has to be encoded.

URL encoding in Python, JavaScript, and PHP

Python
from urllib.parse import quote, unquote, urlencode

# Encode a single value
encoded = quote("hello world & more")
# Result: 'hello%20world%20%26%20more'

# For query string parameters (encodes space as +)
params = {"q": "hello world", "lang": "en"}
query_string = urlencode(params)
# Result: 'q=hello+world&lang=en'

# Decode
decoded = unquote("hello%20world%20%26%20more")
# Result: 'hello world & more'
JavaScript
// Encode a query parameter value
const encoded = encodeURIComponent("hello world & more");
// Result: 'hello%20world%20%26%20more'

// Encode a full URL (leaves :, /, ?, # intact)
const encodedURL = encodeURI("https://example.com/search?q=hello world");
// Result: 'https://example.com/search?q=hello%20world'

// Decode
const decoded = decodeURIComponent("hello%20world%20%26%20more");
// Result: 'hello world & more'
PHP
// Encode a query parameter value
$encoded = rawurlencode("hello world & more");
// Result: 'hello%20world%20%26%20more'

// For form data (encodes space as +)
$encoded_form = urlencode("hello world & more");
// Result: 'hello+world+%26+more'

// Decode
$decoded = rawurldecode("hello%20world%20%26%20more");
// Result: 'hello world & more'

// Build a complete query string
$params = array("q" => "hello world", "lang" => "en");
$query_string = http_build_query($params);
// Result: 'q=hello+world&lang=en'

Quick rule of thumb

Python: use quote() for path segments, urlencode() for query strings.

JavaScript: use encodeURIComponent() for parameter values, encodeURI() for full URLs.

PHP: use rawurlencode() for path segments and parameter values, http_build_query() for form-style query strings.

Common URL encoding mistakes

Double encoding

If you run an already-encoded string through the encoder again, %20 becomes %2520. The % gets encoded to %25. Your server receives hello%2520world instead of hello world. Check whether your string is already encoded before encoding it again.

Encoding the entire URL

Encode individual parameter values, not the whole URL. Encoding https://example.com/search?q=hello turns the ://, /, and ? into %3A%2F%2F and %3F, which breaks the URL entirely. Encode values, not structure.

Confusing + and %20

Both represent a space, but in different contexts. + means space in application/x-www-form-urlencoded data (HTML forms). %20 means space in a URL path. They're not interchangeable. For URL paths, use %20.

Not encoding nested URLs

If you're passing a full URL as a query parameter (such as a redirect URL), encode it in full. ?redirect=https://example.com/callback?code=123 will confuse any parser. It should be ?redirect=https%3A%2F%2Fexample.com%2Fcallback%3Fcode%3D123.

Forgetting to encode the % sign

If your data contains a literal %, it needs to become %25. Otherwise, it'll be read as the start of an encoded sequence.

How to use BotGauge URL Encoder/Decoder

Step 1 - Choose your mode

Click "Encode" or "Decode" depending on what you need.

Step 2 - Paste your text

Enter the string you want to process. This can be a query parameter value, a full URL, a token, or any block of text.

Step 3 - Get your result

The output appears instantly. Click "Copy" to copy it to your clipboard.

The tool uses UTF-8 encoding, the current web standard. No configuration needed for most use cases.

Summary

URL encoding is one of those things you only notice when something breaks. A form submission fails. An API returns a 400. Nine times out of 10, the culprit is a single unencoded character: a raw &, a space that stayed a space, or a % that never became %25. The fix is always the same: encode values before they go into a URL, decode them when they come back out. This tool handles both instantly.

But encoding is just one piece of building reliable web workflows. Your application needs to handle those URLs correctly across browsers, API calls, form submissions, and redirect chains. The only way to know it does is to test it.

BotGauge's Autonomous QA as a Solution (AQaaS) owns the entire test lifecycle. Share your PRDs, demo videos, and UX flows, and our AI agents generate and run tests across your APIs, UI, form submissions, and critical paths. Our domain FDA pod validates every test before it runs.

Teams typically hit 80% coverage in 2 weeks, with self-healing AI that adapts when the UI changes. The URL encoder above is free. If you want that kind of coverage across your whole web application, AQaaS is where to start.

Frequently Asked Questions

Can I use this tool for query strings?
Yes. Paste your query string value directly into the encoder. For example, if you have a search term like C# programming to pass as a URL parameter, paste it in and copy the encoded result.
What is %40 decoded to?
%40 decodes to @. It's the percent-encoded form of the at sign. You'll most often see it in email addresses passed as URL parameters.
What is %25 in a URL?
%25 decodes to %. Since the percent sign marks encoded sequences, it has to be encoded as %25 when you want it to appear as literal data.
Is URL encoding UTF-8?
URL encoding uses UTF-8 as the character set for non-ASCII characters, but they're not the same thing. UTF-8 is a character encoding standard. URL encoding (percent-encoding) is a process that converts bytes into %HH sequences so they can appear safely in a URL. The process uses UTF-8 to determine which bytes to encode.
What is %20 in URL encoding?
%20 is the percent-encoded form of a space. The decimal value of a space is 32, which is 20 in hexadecimal. You'll also see spaces written as + in form-encoded query strings, but %20 is the standard for URL paths.
What's the difference between encodeURI and encodeURIComponent in JavaScript?
encodeURI() encodes a full URL but leaves the structural characters (://, /, ?, &, #, =) intact. encodeURIComponent() encodes everything, including those structural characters. Use encodeURIComponent() for individual parameter values. Use encodeURI() to encode a full URL while preserving its structure.
Why does my decoded URL still look encoded?
You're dealing with double encoding. The string was encoded twice, so decoding it once still leaves percent sequences. Decode it again to get the original text.
What characters should I always encode in a URL?
Anything outside the unreserved set needs encoding. Unreserved characters are letters (A-Z, a-z), digits (0-9), hyphen, underscore, period, and tilde. Everything else (spaces, #, ?, &, =, /, @, and non-ASCII characters) should be encoded in parameter values.
AI-generated, human-verified tests. 80% coverage in 2 weeks. Zero setup.