URL Encoder and Decoder

Encode text so it is safe inside a URL, or decode percent-encoded text.

How to use

  1. Paste your text or URL.
  2. Choose encode or decode.
  3. Press Convert.

Good to know

Use Encode text for query values, which also encodes characters like slash and ampersand. Use Encode a full URL to keep the URL structure.

How Do You Encode and Decode a URL Safely Online?

A free online URL encoder and decoder converts unsafe characters in text or web addresses into percent-encoded form, and turns percent-encoded text back into readable characters. Paste your text, choose an action, press the button, and the converted result appears. This article explains the three modes, how they differ, and how to avoid the errors that catch most people.

What Does the URL Encoder and Decoder Do and Why Is It Useful?

Web addresses can safely contain only a limited set of characters. Spaces, accented letters, symbols and characters that have a special job inside a URL, such as ampersands and question marks, must be written as a percent sign followed by two hexadecimal digits. A space becomes %20, for instance.

The tool saves you from doing that by hand. It is helpful when you need to:

  • Put a search phrase or a name into a query string without breaking the link.
  • Make a link containing spaces or accented letters valid.
  • Read a long percent-encoded address and see what it actually says.
  • Debug a link that opens the wrong page because a character was not escaped.

How Does It Work Under the Hood?

The tool offers three actions, each backed by a standard browser function.

  • Encode text (component) uses encodeURIComponent. It escapes nearly everything that is not a letter, digit or one of a few safe marks. Characters such as / ? : @ & = + $ and # are all escaped. Use this for a single value, such as one query parameter.
  • Encode a full URL uses encodeURI. It leaves the structural characters of a web address alone, so the colon, slashes, question mark, ampersand, equals sign and hash keep working, while spaces and non-ASCII characters are escaped. Use this for a whole address.
  • Decode uses decodeURIComponent. It turns percent sequences back into characters and shows an error message if the input is malformed, for example a percent sign not followed by valid hexadecimal digits.

Non-English characters are first converted to UTF-8 bytes, and every byte is written as a percent sequence. That is why one accented letter becomes two percent groups.

Results appear only after you press the Convert button. The output does not change as you type.

How Do You Use the URL Encoder and Decoder Step by Step?

  1. Paste or type your text or address into the text area.
  2. Choose the action: Encode text (component), Encode a full URL, or Decode.
  3. Press the Convert button.
  4. Read the result below the form. If you chose Decode and the input was malformed, an error message appears instead.
  5. Switch the action and press Convert again to compare modes.

What Do Real Conversions Look Like?

Each result follows the standard percent-encoding rules and was double-checked with a script.

Example 1: Encoding a phrase as a component

Input: hello world & more. Action: Encode text (component). Result:

hello%20world%20%26%20more

Spaces become %20 and the ampersand becomes %26, so it cannot be mistaken for a parameter separator.

Example 2: An accented letter

Input: café. Action: Encode text (component). Result:

caf%C3%A9

The letter é is two UTF-8 bytes, C3 and A9, so two percent groups appear.

Example 3: A path inside a value

Input: a/b?c=d. Action: Encode text (component). Result:

a%2Fb%3Fc%3Dd

The slash, question mark and equals sign are all escaped because component mode treats everything as plain data.

Example 4: A complete address

Input: https://example.com/a b?q=1&r=é. Action: Encode a full URL. Result:

https://example.com/a%20b?q=1&r=%C3%A9

The colon, slashes, question mark, ampersand and equals sign are preserved. Only the space and the accented letter are escaped.

Example 5: Decoding

Input: Caf%C3%A9%20au%20lait. Action: Decode. Result: Café au lait.

Example 6: Decoding a symbol

Input: %E2%82%AC. Action: Decode. Result: the euro sign. Three bytes together make one character.

Example 7: Malformed input

Input: 100%. Action: Decode. A lone percent sign is not followed by two hexadecimal digits, so the tool shows an error message instead of output.

Which Mode Should You Choose?

Choose component mode whenever you are encoding a piece of data that will sit inside a URL, such as a search term, a name, or the value of one parameter. Choose full URL mode when you already have a complete address whose structure should stay intact. If you encode a whole address in component mode, the colon and slashes are escaped and the link stops working as an address. If you use full URL mode on a single value that contains an ampersand or equals sign, those characters stay unescaped and can split the value into extra parameters.

Related tasks: to build clean address paths from titles, use the Slug Generator. For another common encoding, see the Base64 Encoder and Decoder. If you are marking up campaign links, the UTM Link Builder handles parameter encoding for you.

What Tips Help You Get Better Results?

  • Encode each value separately, then join values with the structural characters yourself.
  • Do not encode the same text twice. A second pass turns each percent sign into %25 and produces broken links.
  • Decode only text that was meant to be encoded. Plain text containing a stray percent sign can cause an error.
  • Check results by decoding them again and comparing with the original.

What Common Mistakes Should You Avoid?

  • Double encoding. A value like %20 encoded again becomes %2520.
  • Using the wrong mode. Component mode on a full address breaks it. Full URL mode on a single value misses special characters.
  • Expecting plus signs to decode to spaces. Decoding uses decodeURIComponent, which turns percent sequences back but leaves a plus sign as a plus sign.
  • Decoding partial sequences. A cut-off sequence such as %C3 on its own may be malformed UTF-8 and trigger the error message.

Which Characters Are Reserved in a URL?

A web address uses certain characters as punctuation. The colon follows the scheme, slashes separate path segments, a question mark starts the query, ampersands separate parameters, equals signs join names to values, and a hash begins a fragment. Because they carry meaning, they cannot appear unescaped inside a value that happens to contain them. A company name such as Smith & Sons in a query string must be written with the ampersand escaped, or the address would be read as two separate parameters.

Unreserved characters, which are letters, digits and a few marks such as the hyphen, underscore, period and tilde, never need escaping. Everything else is a candidate. This is why encoded text looks so busy: a short phrase with spaces and punctuation can quickly fill with percent groups.

Example 8: A name with an ampersand in a query

Input: Smith & Sons. Action: Encode text (component). Result:

Smith%20%26%20Sons

Placed after ?company=, the whole name now travels as one value.

Who Uses a URL Encoder and Decoder?

Web developers use it while building links and testing parameters. Marketers use it for campaign addresses that contain spaces or non-English text. Analysts decode long addresses copied from reports. Students learn how web addresses carry data. Support teams use it to read a link a customer reports as broken.

Is Your Text Private?

Yes. Encoding and decoding run entirely in your browser. Your text is not uploaded to a server and is not stored. Refreshing or closing the page clears it.

What Are the Limitations?

  • Three actions only: component encode, full URL encode and decode.
  • Decoding shows an error message for malformed input rather than a partial result.
  • The tool does not check that a link is reachable or that the page exists.
  • Results appear when you press Convert, not as you type.
  • There is no copy button, file upload or download. Select the result and copy it yourself.

Frequently Asked Questions

What is percent encoding?

It is a way to write a byte as a percent sign followed by two hexadecimal digits, so that unsafe characters can travel inside a URL.

What is the difference between encodeURI and encodeURIComponent?

encodeURI keeps characters that structure an address, such as slashes and question marks. encodeURIComponent escapes them too, because it treats the input as a single piece of data.

Why is a space written as %20?

The space character has code 32, which is 20 in hexadecimal.

Why did decoding give an error?

The input contained a percent sign without two valid hexadecimal digits after it, or bytes that do not form valid UTF-8 text.

Does decoding turn a plus sign into a space?

No. Only percent sequences are converted.

Can I encode non-English text?

Yes. Characters are encoded as UTF-8 bytes, each shown as a percent sequence.

Is it safe to paste private links?

The tool runs in your browser and does not upload or store anything.

Convert Your Link Now

Percent encoding becomes routine once you know which mode to pick. Paste a value or address, press the button and check the result against the examples above. You can find many more helpers among our free tools.

Scroll to Top