URL Encoder / Decoder

Encode text so it's safe inside a URL or query string, or decode a percent-encoded URL back to readable text. Choose whole-URL or single-component encoding — all in your browser.

Enter a URL or text and press Convert.

What percent-encoding is

URLs may only contain a limited set of characters. Anything else — spaces, accented letters, &, ?, # and so on — has to be percent-encoded: each unsafe byte is written as a % followed by its two-digit hexadecimal value (in UTF-8).

unsafe byte "%" + hex(byte)

So a space becomes %20 and an ampersand becomes %26. Decoding reverses the process. This keeps query strings, paths and form values unambiguous so servers read exactly what you intended.

Worked example

Encoding the query value tax & fees as a component:

Space → %20
& → %26 (otherwise it would start a new parameter).
Result: tax%20%26%20fees — safe inside ?q=….

Component vs whole URL

Component mode (encodeURIComponent) escapes everything that isn't unreserved, including & / ? # = — use it for a single query value or path segment. Whole-URL mode (encodeURI) leaves the structural characters of a URL intact, so you can encode an entire address without breaking its slashes and separators. Pick component when you're inserting one value into a larger URL.

Tip: to make arbitrary binary or text data URL-safe as a single token, see the Base64 encoder.

Frequently asked questions

What is URL or percent encoding?

It's a way to represent characters that aren't allowed in a URL by writing them as a % followed by their hexadecimal byte value. For example a space becomes %20. This keeps URLs valid and unambiguous.

When should I use component vs whole-URL encoding?

Use component encoding for a single value you're placing inside a URL, such as one query parameter — it escapes & / ? # too. Use whole-URL encoding when you want to encode a complete address without breaking its structure.

Why does & need to be encoded?

In a query string the ampersand separates parameters, so an & inside a value would be misread as the start of a new parameter. Encoding it as %26 keeps it as part of your data.

Does it handle non-English characters?

Yes. Characters are encoded as UTF-8 bytes, so accented letters, emoji and non-Latin scripts are percent-encoded correctly and decode back to the original text.

MB
Mustafa Bilgic · Editor, Calcool
Uses the browser's encodeURIComponent/encodeURI and their decode counterparts. See the MDN percent-encoding reference. Everything runs in your browser — nothing you enter is uploaded, logged or stored.

Related calculators