Skip to main content

URL encoder and decoder

Turn a string into a URL-safe value or decode escaped characters to recover the original text directly in your browser.

  • Clipboard

Embed this widget

Customize the result, check the live preview, then copy the code.

Preview

Embed code type

Code to copy

Responsive and automatically resized by Bethemesh.

Was this tool useful?

How does this tool work?

This tool encodes text so it can safely go into a URL, or decodes a piece of URL full of %C3%A9 and %20 so you can read it. It applies the percent-encoding defined in RFC 3986, useful for building a search parameter, debugging a tracking link or reading a URL copied from server logs.

Encode replaces every character that is not an ASCII letter, a digit or one of - _ . ! ~ * ' ( ) with its %XX form: the text is first converted to UTF-8, so é becomes %C3%A9 (two bytes) and a space becomes %20.

Reserved characters such as /, ?, &, = and # are encoded too: the function is meant for a URL component (a parameter value, a path segment), not for a full address.

Decode does the reverse: each %XX sequence is replaced by the original character, rebuilding multi-byte UTF-8 characters.

If a sequence is incomplete or does not form a valid UTF-8 character (a lone %, %E9 on its own), decoding fails and the tool shows an error message instead of a wrong result.

How to use this tool

  1. Paste the text or URL

    In the Text or URL field: a value to encode or an encoded string to decode.

  2. Choose the action

    Encode or Decode.

  3. Get the result

    Copy the transformed value from the Result field.

  4. Check the round trip

    Decoding encoded text should give back exactly the original text.

Use cases

Build a search URL

Encode the search term before adding it after ?q= so an ampersand or accent does not break the link.

Read a URL from server logs

Decode paths and parameters stored in encoded form in logs or analytics tools.

Debug a redirect link

Decode the redirect_uri or returnUrl parameter of a sign-in link to see the actual address.

Examples

Encode a parameter value

Accented letters become two encoded bytes, the space becomes %20 and the ampersand %26, so the value can go after q= without splitting the query string.

Input

Text or URL: crème brûlée & café · Encode

Result

Result: cr%C3%A8me%20br%C3%BBl%C3%A9e%20%26%20caf%C3%A9

Decode a query string

The encoded = and & signs are restored and the accents become readable again.

Input

Text or URL: q%3Dcr%C3%A8me%20br%C3%BBl%C3%A9e%26page%3D2 · Decode

Result

Result: q=crème brûlée&page=2

Decoding not possible

A % followed by anything other than two hexadecimal digits is not a valid sequence, so the tool reports it instead of inventing a character.

Input

Text or URL: 100% · Decode

Result

Result: Invalid URL content.

Tips and best practices

  • Do not encode a full URL: https:// would become https%3A%2F%2F. Encode only the variable value, then assemble the address.
  • Decoding an already decoded string again can corrupt it if it contains a literal %: decode once.
  • The + sign is not turned into a space when decoding: that is an HTML form convention, not part of percent-encoding.
  • To split a full query string into parameters, the query string tool is a better fit.

Sources and references

Frequently asked questions

What is the difference between encoding a URL and encoding a component?

A full URL keeps its separators (:, /, ?, &) as they are. This tool encodes a component, so it also encodes those separators, which is essential when a parameter value itself contains & or =.

Why does é become %C3%A9 rather than %E9?

The text is encoded in UTF-8, today’s web standard, where é takes two bytes (C3 and A9). %E9 is the old Latin-1 encoding and causes an error when decoding.

Why isn’t + decoded as a space?

In percent-encoding a space is written %20. + means space only in form data (application/x-www-form-urlencoded). Replace + with spaces before decoding if your string comes from a form.

Which characters are never encoded?

The letters A to Z and a to z, the digits and the signs - _ . ! ~ * ' ( ). Everything else, including spaces and accented letters, is encoded.

Is my data sent to a server?

No. Encoding and decoding run in your browser.

Related tools

Tools similar or complementary to this one.

Similar tools

Turn a title or phrase into a clean slug that is ready to use in a URL.

Web & SEOUse this tool

Extract every URL from text and automatically remove duplicate addresses.

Web & SEOUse this tool

Validate, normalize and inspect web addresses locally.

Web & SEOUse this tool
TutorialBest practicesBeginner

Optimize images for the Web without losing quality

Resize, compress and choose between WebP, AVIF and other formats with a practical workflow that reduces file size without unnecessary visual loss.

30 August 20264 min