Quick answer
URL encoding replaces unsafe characters with % followed by two hex digits of each UTF-8 byte, as encodeURIComponent does. 'a b&c=d' becomes a%20b%26c%3Dd.
Choose encode or decode and enter text.
Related tools: Base64 Encode/Decode: Encode text to Base64 or decode Base64 to text (UTF-8). IP Subnet Calculator: IPv4 network, broadcast, mask and host range from an address and CIDR prefix. Download Time Calculator: Time to download a file at a given speed.
How to use the URL Encode/Decode
- Choose direction: Encode and Decode.
- Type text.
- Press Calculate to see the result, and use Reset to start again.
| Input | What to enter | Allowed values |
|---|---|---|
| Direction | Choose one: Encode; Decode | Starts at Encode |
| Text | Text | — |
Formula and method
Formula
percent-encoding of UTF-8 bytes (encodeURIComponent)
IEEE-754 double precision; shown to the decimals indicated.
Leaves letters, digits and - _ . ! ~ * ' ( ) unchanged.
Worked examples
These examples are verified: each one is an automated test case that the live calculator must reproduce exactly.
Example 1
Inputs: Direction = Encode; Text = a b&c=d.
| Result | Value |
|---|---|
| Encoded text | a%20b%26c%3Dd |
Example 2
Inputs: Direction = Decode; Text = a%20b%26c%3Dd.
| Result | Value |
|---|---|
| Decoded text | a b&c=d |
Example 3
Inputs: Direction = Encode; Text = 100% café/ü.
| Result | Value |
|---|---|
| Encoded text | 100%25%20caf%C3%A9%2F%C3%BC |
The first line is the headline result (encoded text). IEEE-754 double precision; shown to the decimals indicated.
Why encode
Characters such as space, &, = and ? have special meaning in URLs. Encoding stops them being read as syntax, so a query value containing & does not split the parameters.
What stays as is
Letters, digits and - _ . ! ~ * ' ( ) are left alone. Non-ASCII characters are encoded as their UTF-8 bytes, so é becomes %C3%A9.
What happens with invalid input
These messages are produced by the calculator itself, so you know what to fix.
- Text: entering "%E0%A4%A" shows "That is not valid percent-encoding." beside that field and no result.
Choosing between the URL Encode/Decode and similar calculators
Each row shows what a related calculator on this site asks for and what it returns, so you can pick the one that matches your question.
| Calculator | You enter | It returns |
|---|---|---|
| [Base64 Encode/Decode](/technology/base64-encode-decode/) | direction and text | Base64 |
| [IP Subnet Calculator](/technology/ip-subnet-calculator/) | iPv4 address and cIDR prefix length | Network |
| [Download Time Calculator](/technology/download-time-calculator/) | file size, size unit and connection speed | Time |
| [Binary Calculator](/technology/binary-calculator/) | first binary number, second binary number and operation | Result |
| [Hex Calculator](/technology/hex-calculator/) | first hex number, second hex number and operation | Result |
Assumptions and limitations
- Encodes component characters such as / ? & =
If a required value is empty, not a number, or outside its allowed range, the form marks that field with a message and shows no result instead of a misleading number. The automated checks deliberately try invalid entries for text to confirm this.
Frequently asked questions
Is a space %20 or +?
%20 here; + is used in HTML forms.
Does it encode a full URL?
It encodes a component; encoding the whole URL would alter : and /.
How do I decode?
Choose Decode and paste the encoded text; %20 becomes a space and so on.
What does the URL Encode/Decode calculate?
Percent-encode text for a URL or decode it. It returns Encoded text.
What formula does the URL Encode/Decode use?
percent-encoding of UTF-8 bytes (encodeURIComponent). Leaves letters, digits and - _ .
What do I need to enter in the uRL Encode/Decode?
You enter Direction and Text.
How is the result rounded or limited?
IEEE-754 double precision; shown to the decimals indicated. Encodes component characters such as / ? & =.
What does the “Direction” option change?
It sets how the uRL Encode/Decode is worked out. The choices are Encode and Decode.
What is an example of a uRL Encode/Decode result?
With direction Encode and text a b&c=d, the encoded text is a%20b%26c%3Dd.
Where does the method come from?
The method follows: RFC 3986 percent-encoding; ECMAScript encodeURIComponent.
Related calculators
- Base64 Encode/Decode — Encode text to Base64 or decode Base64 to text (UTF-8).
- IP Subnet Calculator — IPv4 network, broadcast, mask and host range from an address and CIDR prefix.
- Download Time Calculator — Time to download a file at a given speed.
- Binary Calculator — Add, subtract, multiply, divide or apply bitwise operations to binary numbers.
- Hex Calculator — Add, subtract or multiply hexadecimal numbers.
- Decimal to Hex Converter — Convert integers between binary, octal, decimal and hexadecimal.
Sources
- RFC 3986 percent-encoding; ECMAScript encodeURIComponent
Content last reviewed 2026-11-04. Formulas and worked examples are checked by automated tests against independently computed values.