# URL Encoder and Decoder

> Percent-encode text for use in a URL query or path, or decode %XX sequences back to readable text, with UTF-8 and form (+ for space) modes.

Category: IT, networking & security · Applies to: Worldwide · Last updated: 2026-10-29
Interactive calculator: https://calculators.geekmidst.com/calculators/url-encoder-decoder

URLs may contain only a limited set of characters. Everything else is percent-encoded: each UTF-8 byte becomes % followed by two hex digits, so a space becomes %20 and é becomes %C3%A9.

Also called: Percent-encoding tool, URL escape tool.

## Inputs
- Action (options: Encode, Decode; default encode)
- Encoding for (options: A query value or path segment (RFC 3986), An HTML form value (space as +), A whole URL (keep : / ? & = #); default component)
- Text (default café & crème = 100%)

## Results
- Result
- Length

## Formula

```
Keep A–Z a–z 0–9 - . _ ~; replace every other character by the %XX hex code of each of its UTF-8 bytes.
```

Where:
- %XX: a byte value in hexadecimal, e.g. space = %20, & = %26, é = %C3%A9

## Worked example
1. Letters a, b, c, d are unreserved and stay as they are.
2. Space → %20, & → %26, = → %3D.

**Result:** "a b&c=d" encodes to a%20b%26c%3Dd, safe to use as a single query value.

## What the result means

Encode each query value separately, then join them with & and =. Encoding a whole URL with the component option would also escape the : / ? characters that give the URL its structure.

## Assumptions and limits
- UTF-8 encoding, as specified for URLs by RFC 3986 and the WHATWG URL standard.
- The whole-URL option leaves reserved characters such as & and = untouched, so it cannot tell a literal & in a value from a separator.

## Questions

### Should a space be %20 or +?

Both appear. %20 is correct anywhere in a URL; + means space only in form-encoded query strings (application/x-www-form-urlencoded).

### Why did decoding fail?

A % must be followed by two hex digits, and the bytes must form valid UTF-8. A stray % in the text should itself be encoded as %25.

## Sources
- [RFC Editor (RFC 3986: Uniform Resource Identifier, Generic Syntax)](https://www.rfc-editor.org/)

## Related calculators
- [Base64 Encoder and Decoder](https://calculators.geekmidst.com/calculators/base64-encoder-decoder)
- [Website Bandwidth Calculator](https://calculators.geekmidst.com/calculators/bandwidth-calculator)
- [Roman Numeral Converter](https://calculators.geekmidst.com/calculators/roman-numeral-converter)

Source: GM¹X CalcVerse — https://calculators.geekmidst.com/calculators/url-encoder-decoder
