Why URLs Need Encoding
A URL can only contain a limited set of characters. Some characters have special jobs: ? starts the query string, & separates parameters, = links a name to a value and # marks a fragment. Others, such as spaces, quotes, Hindi letters or emojis, are not allowed at all. If you put them into a URL unchanged, the link may break or the server may read the wrong value.
URL encoding (percent-encoding) fixes this by replacing each problematic character with % plus its hexadecimal byte value. This tool encodes text so it is safe to place in a URL, and decodes messy encoded URLs back into readable text.
How to Use the URL Encoder / Decoder
- Select URL Encode or URL Decode.
- Type or paste your text (use Paste for quick input).
- The result appears instantly. Copy it with one click.
- If a string can’t be decoded, a clear error message explains why.
Examples
| Original | Encoded |
|---|---|
hello world & more? | hello%20world%20%26%20more%3F |
chai & samosa | chai%20%26%20samosa |
price=100/kg | price%3D100%2Fkg |
क | %E0%A4%95 |
Common Percent-Encoded Characters
| Character | Encoded | Character | Encoded |
|---|---|---|---|
| space | %20 | & | %26 |
/ | %2F | = | %3D |
? | %3F | # | %23 |
: | %3A | + | %2B |
@ | %40 | % | %25 |
A Practical Example
Suppose you are building a search link and the user searches for chai & samosa. If you insert it directly:
https://example.com/search?q=chai & samosa
the server sees the parameter q=chai followed by a broken second parameter. Encoding the value first gives the correct link:
https://example.com/search?q=chai%20%26%20samosa
encodeURIComponent vs encodeURI
JavaScript offers two functions:
encodeURIComponent()encodes nearly everything, including/ ? & = :. Use it for individual values such as query parameters. This tool uses it.encodeURI()leaves URL structure characters alone. Use it when encoding a complete URL that only has a few unsafe characters, like spaces.
In PHP the equivalents are rawurlencode() (spaces as %20) and urlencode() (spaces as +).
Who Uses This Tool?
- Developers building API requests, redirect URLs and OAuth callback links.
- Digital marketers creating UTM-tagged campaign links.
- SEO specialists reading encoded URLs from analytics and crawl reports.
- Anyone trying to make sense of a long, unreadable link full of % signs.
Related Tools
- Base64 Encoder / Decoder — another way to make data text-safe.
- JSON Formatter — read API responses clearly.
- Case Converter — create lowercase kebab-case URL slugs.