Skip to content
CalculatorAtlas

URL Encode/Decode

Tested

Percent-encode text for a URL or decode it.

Tested, not yet published. The formula for this calculator is implemented and passes its automated checks. This page stays non-indexable until it is reviewed and published.

Results

Enter your values and press Calculate. Results appear here.

  • • Result

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

  1. Choose direction: Encode and Decode.
  2. Type text.
  3. Press Calculate to see the result, and use Reset to start again.
Inputs of the URL Encode/Decode
InputWhat to enterAllowed values
DirectionChoose one: Encode; DecodeStarts at Encode
TextText—

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.

Results of example 1
ResultValue
Encoded texta%20b%26c%3Dd

Example 2

Inputs: Direction = Decode; Text = a%20b%26c%3Dd.

Results of example 2
ResultValue
Decoded texta b&c=d

Example 3

Inputs: Direction = Encode; Text = 100% café/ü.

Results of example 3
ResultValue
Encoded text100%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.

Choosing between the URL Encode/Decode and similar calculators
CalculatorYou enterIt returns
[Base64 Encode/Decode](/technology/base64-encode-decode/)direction and textBase64
[IP Subnet Calculator](/technology/ip-subnet-calculator/)iPv4 address and cIDR prefix lengthNetwork
[Download Time Calculator](/technology/download-time-calculator/)file size, size unit and connection speedTime
[Binary Calculator](/technology/binary-calculator/)first binary number, second binary number and operationResult
[Hex Calculator](/technology/hex-calculator/)first hex number, second hex number and operationResult

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.

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.